[Zope] Zclass subclassing Image - how to manage uploads?

Michel Pelletier michel@digicool.com
Wed, 15 Mar 2000 13:08:16 -0800


Marius Kjeldahl wrote:
> 
> 
> Ok, I guess this is where I get confused. When is the REQUEST['file']
> instance
> a string and when is it not? If I try to replace the manage_upload call
> with
> your suggestion, I get a message saying:
> 
> Error Type: AttributeError
> Error Value: 'string' object has no attribute 'read'

Your form element should be:

<input type=file name="file_name:file">

The ':file' is necessary to marshal the file into a file object.  I was
going on the assumption that you had done that otherwise as you've
discovered it will turn it into a string, which you may or may not want.

-Michel

PS Don't forget the ENCTYPE="multipart/form-data" on your <form> tag.