[Zope] manage_addFile question

Dimitris Andrakakis dandraka_info@yahoo.com
Mon, 26 Mar 2001 16:08:58 +0300


Hi all,
I'm trying to set up a form to let my users upload
files in a certain folder. The form is like this:

<form action="fileadd" method="get" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="Submit file">
</form>

and the "fileadd" dtml method like this:

<dtml-call "PARENTS[0].manage_addFile('testfile.pdf', file)">

This works ok. Two questions:
1) I think it's possible to ommit the id, and zope will by default
use the uploaded file's filename (just the way you upload a file from
the management screens). But how ? I've tried both manage_addFile('', file)
and manage_addFile(file) but they don't work.
2) How can I put the file in a subfolder ? Say my form is in /, and I want
to save the file in /files. I've tried:

<dtml-with files>
<dtml-call "PARENTS[0].manage_addFile('testfile.pdf', file)">
</dtml-with>

but to no avail :-( Anybody ?

Dimitris @ Nuclear