[Zope] External Method not accepting CGI module

Kelvin Cheong kcheong@vcn.com.my
Mon, 10 Jul 2000 06:11:39 GMT


Dear All,

I have this python module for uploading an image from a client to the
server (which would be subsequently inserted into a MySQL database, which
is still on the midst of being resolved). I''m trying to import this into
Zope as an External MEthod. It's contents are as follows :



import cgi

form = cgi.FieldStorage()

fileitem = form["userTABPIX1"]

	fname = tempfile.mktemp()
	fp=open(fname,'w')
	fp.write(fileitem.file.read())
	fp.close()



However, Zope generates this error :

Zope has encountered an error while publishing this resource.

		Error Type : KeyError
		Error Value: userTABPIX1


Apparently, this piece of code is supposed to work. I grabbed it off the
mailing list, and I've compared with the python references and tutorials. 

Is it because it's not meant to be used as an External MEthod? 

If so, can anybody suggest a way for me to upload files from the client to
the server which will subsequently be inserted into a mySQL db?


I posted another message in the archive earlier on which describes my
previous attempts in inserting an image into the mySQL database from a
form.



Thanx,
k.c.

VCN - The Leader In Corporate Communication Solutions
Visit our website at http://www.vcn.com.my. 
or http://www.vcnlinux.com