[Zope] file upload and MySQL

Dieter Maurer dieter@handshake.de
Mon, 18 Sep 2000 23:59:34 +0200 (CEST)


=?iso-8859-1?q?J=F8rn?= Helge B. Dahl writes:
 > So, what I do not know, is how I "extract" the information from the file
 > upload, and make it available to my sqlMethod.
This is an FAQ (answer found in the searchable list archive!).

Uploaded files are "ZPublisher.HTTPRequest.FileUpload" instances.
They behave like files with the additional attributes
"filename" and "headers".
To get the size, you may need to use "seek" (to the end) and "tell".

You make this information available to an sql method
as you make any parameter available for them:

	either: put them in the REQUEST object (--> REQUEST.set)
	or: call the sql method with keyword parameters


Dieter