ZIP files corrupted by IE

I am delivering a ZIP file in 64k fragments using a loop in PHP (but the problem would have occurred with any language on the server side).

When extracting a file using FF, everything goes fine.

When extracting a file with IE7, some bits become damaged. This results in an error message regarding the wrong CRC (hash), and some unpacked files will eventually get corrupted.

Headers sent:

Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Pragma: public
Content-Description: File Transfer
Content-Disposition: attachment; filename="671fb8f80f5e94984c59e61c3c91bb70.zip";
Content-Transfer-Encoding: binary
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/octet-stream

Does anyone have a clue where this corruption comes from?

+3
source share
3 answers

Thanks to the previous answers, I was able to solve the problem:

Apache mod_deflate gzip. :

  • Content-Length
  • IE7

, php, , :

apache_setenv('no-gzip', '1');
+6
Content-Encoding: gzip

gzip ( ) ? , - , PHP, , ?

+3

MSDN , IIS ZIP gzip, . Firefox, , , . , , .

IIS.

+1

Source: https://habr.com/ru/post/1719975/


All Articles