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

John Schinnerer johnschinnerer at yahoo.com
Fri Mar 26 19:05:15 EST 2004


Hello,

I need to test form data passed in REQUEST to see if there is or is not
a file specified to upload.
The form element is

<input type="file" name="image_file" size="35" value="" />

I tried testing for an empty field like with string and text variables,
like so:

if REQUEST.image_file != '':

But that always seemed to be true even when I left the form field
blank.
So I lookd at REQUEST and it shows this:

image_file    <ZPublisher.HTTPRequest.FileUpload instance at 0x89ef9d4>

That's new to me...
How do I reference the string in that field to test if it's empty or
not, *or* do some equivalent test that tells me there is or is not a
file specified to upload?

Thanks,
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