I am using python zlib and I am doing the following:
- Compress large strings in memory (
zlib.compress) - Upload to S3
- Download and read and decompress the data as string from S3 (
zlib.decompress)
Everything is working fine but when I directly download files from S3 and try to open them with a standard zip program I get an error. I noticed that instead of PK, the begining of the file is:
xµ}ko$7’םחע¯¸?ְ)$“שo³¶w¯1k{`
I am flexible and dont mind switching from zlib to another package but it has to be pythonic (Heroku compatible)
Thanks!
zlibcompresses a file; it does not create a ZIP archive. For that, seezipfile.