[Zope] zlib (zip a file)

belen@netcom.no belen@netcom.no
Tue, 10 Jul 2001 16:22:52 +0100


Hi again,

Thanks for your help. What I intend to do is to compress a set of 
pages, download them all together and decompress them after having 
downloaded it. (The download bit is done)

Having had a look to the documentation I wonder how can I pass several 
pages and compress them as a whole. And which is the right method to 
compress them to have them in a propper format that allows them to be 
decompressed after being downloaded.

I have tried to do it for one page...but zope seems to laugh at me...:(

The method I have used is:
import zlib
def compress_data(data):
	x = zlib.compress(data,6)


To return :

<dtml-call "REQUEST.RESPONSE.setHeader('content-type','text/html')">
<dtml-call "REQUEST.RESPONSE.setHeader('Content-
Disposition','Attachment; Filename='+document+'.html')">
<dtml-return "compress_data(_['document'])">

Has anyone done something like this before? I would be really grateful 
if someone could help me.

Thaks again

belen

----- Original Message -----
From: "Andreas Jung" <andreas@andreas-jung.com>
Date: Tuesday, July 10, 2001 2:47 pm
Subject: Re: [Zope] zlib

> http://www.python.org/doc/current/lib/module-zlib.html
> 
> >From: <belen@netcom.no>
> >Subject: [Zope] zlib
> > Hello there,
> > 
> > Has anyone used this module before (zlib)? Can anyone show me an 
> > example of how to use it? I have REALLY tried to search for it 
> but 
> > nothing comes out.
> 
> 
>