Knowledge Base I'm receiving a file is corrupt error when...

I'm receiving a file is corrupt error when download a file using the Download Expander link.

Author Bill Brewer
Created
A corrupt file can be caused by a number of different items.

1. Whitespace being sent out of the PHP file before the contents of the zip file. If you see this message on your site sometimes "If the page is not updated in 2 seconds, please follow this link" this may be the cause. Here are instructions for finding this extra whitespace.

2.  You may be using Zlib compression.  This can corrupt the .zip file. 

--If zlib is enabled in the .htaccess file use the following code to disable this for the download.php file:

<FilesMatch download.php> php_flag zlib.output_compression Off </FilesMatch>
-- If zlib is enabled in your php.ini file you can disabled it by adding this code to the top of the download.php file:

@ini_set('zlib.output_compression', '0');
3.  Your site is timing out during the download. If the .zip file download is smaller than the file on the server the site is timing out before the entire contents of the download have been received by the customer. You can try to add this to the top of the download.php file to extend the execution time, but some web hosts disable this:

@set_time_limit(1000);

Was this article helpful?

Yes
No