Portal Home > Knowledgebase > cPanel > Zip file corrupted


Zip file corrupted




This usually happens when you have the "Optimize Website" option enabled in cPanel.

When you enable this option you are enabling Gzip compression in your website, which compress the data transferred between the server and your browser, so .zip files in your site are being compressed again when you download them from the website.

To avoid this happen you can either disable the "Optimize Website" function in cPanel or you can add an exception in the .htaccess file in your account to do not use Gzip for files with .zip extension.

To do this simply edit (or create a new .htaccess file if you do not have one) in your public_html directory with the following lines into it:

SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary

That should prevent double compression issues and allow zips to not be corrupted.

Note: We have seen this is happening only when you are using Internet Explorer 7 or 8 with HTTP 1.1 enabled in the Advanced settings. With other browsers we are unable to reproduce the problem.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Configure ASSP deluxe (Views: 7631)
PHP version (Views: 7062)
Backup account (Views: 4658)
Server propagation (Views: 5350)
cPanel mail setup (Views: 4346)