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

Alec Munro alecmunro at gmail.com
Wed May 10 11:52:58 EDT 2006


Hi again,

As it turns out, the data is available as a FileUpload object, which I
can use just like a file, and that works quite well.

Thanks for reading,

Alec

On 5/10/06, Alec Munro <alecmunro at gmail.com> wrote:
> 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