problems uploading zipfile with cgi
nehalmistry at gmx.net
Tue Nov 23 23:58:05 CET 2004
On Tue, 23 Nov 2004 17:21:49 -0500
"Matthew Perpick" <mperpick at wgen.net> wrote:
> Hello All,
> trying to upload a zip file to a python cgi-script and I am
> having some trouble. the form has enctype="multipart/form-data".
> i can access the file as a string like this:
> zip = form.keys['zip_file'].value
> but I cannot seem how to create a ZipFile object from this data.
> It only wants a filename or a "file-like object" in the
> can anyone help? I am a little bit lost.
StringIO.StringIO(form.keys['zip_file'].value) will create a
file-like object that you can use to construct the ZipFile
More information about the Python-list