When I download the original zip it works fine, but when I download it using the below headers and stuff it doesn't work. I know it's better to take this route and tell the browser how to handle the file rather than leave it up to the browser, but I can't get this to work, so I'm tempted to use a header() forward.
$path = $this->tru->config->get('root.path').'/Digital Version of Book for Web.zip';
set_time_limit(0);
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-Type: application/zip');
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename="NewFileName.zip"');
header('Content-Length: ' . filesize($path));
$f = fopen($path, 'rb');
fpassthru($f);
fclose($f);
Edit:
Sorry, what I mean by it doesn't work is that the file downloads in a zip format (all 9.3 MB) but I'm unable to unpackage the zip because it's invalid.