oh now i get it yes, manage_addFile() should (with the cookId() method) generate it if its not set hm, i suggest you take a look at lib/python/OFS/Image.py and try to debug this by adding some print statements. sorry for not being more specific... peter. On Fri, 26 Apr 2002, Roger Ineichen wrote:
I'm not sure, but the id should in the python method manage_addFile() set with the filename if nothing is given. ??? Is it not this way?
Thanks Roger Ineichen ___________________________ END OF MESSAGE
well i guess its empty because you dont set it :-) maybe you should add an entry field
<input name="id" />
or something like that?
cheers, peter.
On Fri, 26 Apr 2002, Roger Ineichen wrote:
Knows sombody why the id is '' (empty) and the funktion not work?
I send a file with a form: ----------------------------- <form action="addFile" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="submit" value="upload"> </form>
To the python method: --------------------- def addFile(self,file): "This method adds a file" # create the file self.manage_addProduct['OFSP'].manage_addFile(id='', title='', file=file)
# redirect to main page return self.REQUEST.RESPONSE.redirect(index_html, url_quote(message)))
The error is: ------------- The id "" contains characters illegal in URLs.
Mit freundlichen GrĂ¼ssen Roger Ineichen ___________________________
Projekt01 GmbH www.projekt01.ch Langackerstrasse 8 6330 Cham phone +41 (0)41 781 01 78 mobile +41 (0)79 340 52 32 fax +41 (0)41 781 00 78 email r.ineichen@projekt01.ch ___________________________ END OF MESSAGE
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )