Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a zip file being served by Apache with mod_gzip compression turned on. Everything is fine when the file is downloaded with Firefox. When downloaded with IE7 the zip file is corrupt. Any suggestions? Do I need to change the mime type for zip files or perhaps exclude zip files from gzip compression?

share|improve this question
add comment

3 Answers 3

What MIME type are you sending along with the .zip file? I have had errors similar with dynamic download pages (such as download.php sending a file) and compression. When using something like application-zip and Content-Encoding: gzip, IE would not uncompress the file. I corrected this by using a MIME type of application/octet-stream, if I recall correctly.

That being said, you should probably exclude .zip from gzip compression anyway, since it's probably useless if not actually hurting performance.

share|improve this answer
add comment

This problem is a known issue with Internet Explorer 7 and 8. Those browsers do not handle correctly zip content type with gzip content encoding. The 8 release of IE has still some audience since it is the last release available on XP.

Enabling http compression on a zip is somewhat redundant, but it is technically valid. And in some cases, one may not have the choice to exclude zip from http compression, depending on technologies used.

So, if you want to enable a workaround on your web servers for users of Internet Explorer 7 or 8 to be able to get valid zip, as said in Microsoft KB, either disable http compression on zip content, or change the zip mime-type to octet-stream on your servers.

share|improve this answer
add comment

you should definitely exclude the zip file from gzip compression. There is no need in compressing already compressed content again. This is not only valid for zip files but also for jpg and so on.

share|improve this answer
    
Note that zip files may be used as simple containers, without compression. (It allows you to put a large number of files in a single file, for distribution convenience.) It isn't commonly done, but it's definitely technically valid. –  Michael Kjörling Sep 6 '13 at 9:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.