[Zope] Re: File Upload problems

Maik Jablonski maik.jablonski@uni-bielefeld.de
Mon, 10 Mar 2003 20:54:26 +0100


Mark Evans wrote:
> Hi all,
> 
> I am trying to upload an image file from a form to an External Method so that it
> can be loaded as a blob into an Oracle database.  I am having difficulty getting
> the file uploaded.
...
> The gist of the error received, is that image is a "
> ZPublisher.HTTPRequest.FileUpload instance at 1046b04"
> instead of being something I can acutally manipulate.  Why is this and how do I
> access either the file or the URL pointing to the file?

Please read the source... Zope/lib/python/ZPublisher/HTTPRequest.py 
defines the FileUpload-Class:

class FileUpload:
     '''\
     File upload objects

     File upload objects are used to represent file-uploaded data.

     File upload objects can be used just like files.

     In addition, they have a 'headers' attribute that is a dictionary
     containing the file-upload headers, and a 'filename' attribute
     containing the name of the uploaded file.
     '''

It's all there you need...

-mj
-- 
Universität Bielefeld - Zentrum für Lehrerbildung
http://www.zfl.uni-bielefeld.de
tlph://+49.0521.106.4234