[Zope] filefield value when empty

Marie Robichon robichon@esrf.fr
Tue Aug 5 10:57:13 EDT 2003


Hi everyone,

I figured this one out for myself and thought maybe someone would be 
interested in the answer.  I found  that even when no value is added to the 
field using the browse button, (and even despite defining a default value) 
the REQUEST shows a 'FileUpload instance object'.  Therefore you have to 
check that the filename attribute of this fileupload instance object is empty:

if getattr(file, 'filename')!="":
    do something ........

Hope this can be helpful to someone,

Marie







More information about the Zope mailing list