[Zope] External Method not accepting CGI module

Dieter Maurer dieter@handshake.de
Wed, 12 Jul 2000 00:50:02 +0200 (CEST)


Kelvin Cheong writes:
 > import cgi
 > 
 > form = cgi.FieldStorage()
This gives you an empty "FieldStorage"
 > 
 > fileitem = form["userTABPIX1"]
In it, "userTABPIX1" is unknown.
 > 
 > 	fname = tempfile.mktemp()
 > 	fp=open(fname,'w')
 > 	fp.write(fileitem.file.read())
 > 	fp.close()
Give your external method either the first argument "self"
or an argument "REQUEST".

In the first case, you can use "REQUEST=self.REQUEST" to
get the REQUEST object. In the second case, you use
REQUEST directly.

"REQUEST.form" contains the form variables of the REQUEST.



Dieter