If you are using a downloader script to provide download and the downloaded zip file is corrupted, don’t panic, follow the steps below.
It is possible that your zip file is not uploaded completely. In my case, I uploaded 2 zip files via FTP software and they actually corrupted itself. Then I wasted 2 hours looking for solution using Google.
The script should only output the content zip file. Even an extra space character might cause problem.
Another possibility is : Byte Order Mark – BOM exists in your download script file. To ensure BOM doesn’t exist, open the file using NotePad++, click Format > Encode in UTF-8 Without BOM
Still not working? The problem might be in your header() strings. Compare your header strings with this.
$filename = 'path_to_your_file.zip';
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-control: public");
header("Content-Description: File Transfer");
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($filename) );
If it is still not working, contact your host and explain your problem to them.
I was fed up by the script i used and i found almost the same script in all forums and by chance i visit you site and after reading first point i downloaded the zip file by ftp and xtract that and come to know that zip file is not being uploaded perfectally to my server. So many thanks buddy :)
This part saved the day for me:
Even an extra space character might cause problem.
Many thanks