[Zope] How do I test for file to upload (or not) via REQUEST data?

John Schinnerer johnschinnerer at yahoo.com
Sat Mar 27 16:11:14 EST 2004


Hello,

> If you use the standard html input tag to get the user to select a
> file
> 
> eg.   <input type="file" name="fname">
> 
> Then what you see in REQUEST is 'fname' as a 'fileupload instance'
> (not a file name).  'fname'  has  an attribute called 'filename'...

Thanks!  That was just the info I needed.  In my case it's in python:

# if filename not empty, replace current image file
if REQUEST.image_file.filename != '':
    self.manage_delObjects(...blah...)
    self.manage_addImage(...blah blah blah...)

thanks again,
John S.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



More information about the Zope mailing list