[Zope] FileUpload and Python Script

Dieter Maurer dieter@handshake.de
Sun, 17 Jun 2001 21:25:10 +0200 (CEST)


Tom Deprez writes:
 > Can somebody help me on how I can get the filename of a FileUpload object in
 > a python script?
 > 
 > When using following code in a python script,
 > 
 > context.REQUEST['accessory_image'].filename
 > 
 > I get always the following error :
 > 
 > Error Type: AttributeError
 > Error Value: 'string' object has no attribute 'filename'
"REQUEST['accessor_image'] is a string and not a FileUpload
instance.

Are you sure, you followed the preconditions for file upload?

  *  method='post'

  *  enctype='multipart/form-data'

  *  input type=file


Dieter