My PHP script forces a file to download, which all works fine, but when forcing zip files to download, they corrupt.
When I try and open the zip file locally it just converts from a .zip
to a .zip.cpgz
If I download the file from a direct URL the zip file is fine, so I know it's only corrupting during the push/download phase.
Here's my code
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"_zip_download.zip\"");
header("Content-Transfer-Encoding: Binary");
header("Content-Description: File Transfer");
header("Content-Length: " . filesize($zip_file));