Zope Product - zipfile not compressing
Hello folks, I wrote a custom zope product that I wanted to use create a zip archive from some of the files on the filesystem and then send this zipfile as a download. The product works, the zipfile gets created and all the files are there, only there appears to be no compression at all. Everything is just stored. Here is how I create the archive: zip = zipfile.ZipFile(file_name, mode='w', compression=zipfile.ZIP_DEFLATED) then I keep adding with writestr: zip.writestr(zinfo, obj_data) any thoughts? thanks and best regards. Istvan.
Istvan Albert wrote:
The product works, the zipfile gets created and all the files are there, only there appears to be no compression at all.
What leads you to believe there is no compression? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
If the input files are already compressed, further compression may not be possible. On Thu, 1 Apr 2004, Chris Withers wrote:
Istvan Albert wrote:
The product works, the zipfile gets created and all the files are there, only there appears to be no compression at all.
What leads you to believe there is no compression?
Chris
-- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Chris Withers wrote:
The product works, the zipfile gets created and all the files are there, only there appears to be no compression at all.
What leads you to believe there is no compression?
The way I noticed it was that the files were to big, basically the sum of all files (the files that I pack are text files) And I can open up the zip file and the contents of it is readable text. What I'm thinking is that maybe the zlib import fails and it silently defaults back to zipfile.ZIP_STORED Another method in this product has no problems in unpacking zip files that I upload. thanks, Istvan.
participants (3)
-
Chris Withers -
Dennis Allison -
Istvan Albert