[Zope] upload files from forms

Heiko Stoermer heiko@mig.net
Mon, 06 Sep 1999 00:17:56 +0200


linuxcraft@scorpio.redspice.com wrote:

> Anybody tried using the form wiht file input type. Zope uses this
> to upload html files from user's disk. Question is how does it
> access the file in the form variables. I cannot see anything in the
> request
> that shows a file. When I access the file variable all I can see is a
> file name
> that the user entered. Any ideas ?
>

the object that zope uses to download file data is an instance of the
ZPublisher.HTTPRequest.FileUpload class.
you can access the fully qualified filename through its "filename"
attribute.
you can pass the object into an External Method, where it works similar
to a filehandle, or use it in DTML's manage_addFile() or
manage_addImage().
see zope/lib/python/ZPublisher/HTTPRequest.py for the definition of
FileUpload and zope/lib/python/OFS/Image.py for details about the
manage_add*() routines.
there's no further documentation that I know of, but the source is
commented...

hope this helps,
Heiko


--
Heiko Stoermer
MIG Augsburg