problems uploading zipfile with cgi

Nehal nehalmistry at gmx.net
Tue Nov 23 17:58:05 EST 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
> constructor.
> 
> can anyone help? I am a little bit lost.
> 
> Matt
> 
StringIO.StringIO(form.keys['zip_file'].value) will create a
file-like object that you can use to construct the ZipFile
-- Nehal



More information about the Python-list mailing list