Closed Bug 168180 Opened 22 years ago Closed 22 years ago

zip files downloaded with Content-Encoding: gzip are saved with gzip file header on top of the zip file header

Categories

(Core Graveyard :: File Handling, defect)

x86
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 152275

People

(Reporter: dharana, Assigned: law)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826 Zip files sent compressed with gzip (php option: zlib.output_compression On) are saved with gzip header. Reproducible: Always Steps to Reproduce: 1.activate output compression to all your webserved files (including zip files) 2.download any .zip file from the webserver Actual Results: File is saved in gzip format (not expected) BUT with the filename.zip (as expected). Expected Results: Mozilla should uncompress all files sent with HTTP header Content-Encoding: gzip before saving or opening them.
Summary: zip files are saved with gzip headers instead of without gzip headers → zip files downloaded with Content-Encoding: gzip are saved with gzip file header on top of the zip file header
I hope this helps: WORKING HTTP/1.1 200 OK Date: Thu, 12 Sep 2002 12:29:36 GMT Server: Apache/2.0.35 (Unix) mod_ssl/2.0.35 OpenSSL/0.9.6c PHP/4.3.0-dev Last-Modified: Thu, 05 Sep 2002 13:31:52 GMT ETag: "d618a-26c80-937ac200" Accept-Ranges: bytes Content-Length: 158848 Connection: close Content-Type: application/zip NOT WORKING HTTP/1.1 200 OK Date: Thu, 12 Sep 2002 12:28:26 GMT Server: Apache/2.0.35 (Unix) mod_ssl/2.0.35 OpenSSL/0.9.6c PHP/4.3.0-dev Accept-Ranges: bytes X-Powered-By: PHP/4.3.0-dev Set-Cookie: PHPSESSID=8e3aab4286454982b96f77962c19d4e6; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: public Pragma: no-cache Content-encoding: gzip Content-Disposition: attachment; filename=dm-embryonic.zip Connection: close Content-Type: application/force-download
From memory, this may be deliberate. I'm sure I remember something about a workaround that would ignore the Content-Encoding header if the filename indicated that the file was a compressed file anyway. I think that this may have been because a default/common install of Apache 1.x causes .gz (for example) files to be sent with the Content-Encoding header set to 'gzip' even though the server does not recompress the file. That was causing Mozilla to decompress the file - meaning that a .tar.gz file downloaded with Mozilla would be decompressed to a .tar, but still be named .tar.gz. IF that is the case (and as I say, this is from memory), then I'm not sure how we can easily fix this bug without regressing that one.
And in fact, this is a duplicate of bug 152275. bz's comment (bug 152275 comment 4) describes the problem pretty well. Also see bug 119373. Can you switch off recompression for already-compressed files? That would fix the problem. *** This bug has been marked as a duplicate of 152275 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Thanks Malcolm, sorry I didn't saw it (I really didnt saw it when searching for duplicates). I'm trying to disable zlib.output_compression for php in an specific php script but it's getting hard. Btw it's nice to see you're already working on it =)
vrfy dupe
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.