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

Marius Kjeldahl marius@funcom.com
Wed, 15 Mar 2000 21:59:39 +0100


Michel Pelletier wrote:
> 
> Marius Kjeldahl wrote:
> >
> > Right before the "propertysheets..." line I have tried adding the
> > following:
> >
> >   <dtml-call "manage_upload(REQUEST['file'])">
> 
> I *think* you want REQUEST['file'].read().  manage_upload wants a string
> of data, not a file object.

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'

which indicates that REQUEST['file'] is a string at this stage (and
probably
the filename or similar). From the input form I guess "file" is a string
(at
least that is what it looks like in the input form - the filename) at
least
until I press the submit button. When it actually changes from the
filename
to a file I do not know.

Any other suggestions on how to get hold of that file?

Thanks,

Marius Kjeldahl