[Zope] File Upload problems

Mark Evans mark.evans.b@bayer.com
Mon, 10 Mar 2003 11:51:51 -0800


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.

Here is the form:

<form  action="execute_loadblob" method="post"  enctype="multipart/form-data">
<p>Locate file to upload:</p>
<input type="file" name="image" size="16">
<input type="submit" name="submit" value="Submit Entry">
</form>
=======================================================================

The external method is called from a DTML method called "execute_loadblob" which
contains the call:

<dtml-var expr="writeBlob(image)">

The external method is:

import sys,os,string,DCOracle2 as dco
def main(image):
     ...
     do something here with image, doesn't matter what
     ...
      return "Something was done"

=============================================================

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?

TIA,

Mark Evans