[Zope3-Users] Uploading and extracting a zip file.

Alec Munro alecmunro at gmail.com
Wed May 10 11:39:19 EDT 2006


Hi List,

This seems like it should be relatively easy to solve, but I haven't
been able to find a solution so far.
I want to upload a zip file to a certain component, and have the
component automatically extract and process the contents of the zip
file.
In this case, I'm uploading an odt file, and I want to extract the
content.xml and process it.

The tricky part is actually accessing the zip file. I get the raw data
all right, but ZipFile requires a file-like object or path. I tried
using StringIO to wrap the data, and passing that to ZipFile, but then
I get "BadZipfile: File is not a zip file".

Thanks for any help.

Alec Munro


More information about the Zope3-users mailing list