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

Chris Withers lists at simplistix.co.uk
Mon Mar 29 10:37:18 EST 2004


John Schinnerer wrote:

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

good man!

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

...slight refinement for some browsers:

file = REQUEST.image_file
if file and file.filename != '':
      self.manage_delObjects(...blah...)
      self.manage_addImage(...blah blah blah...)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope mailing list