If you are using the code for the Content-Length:
header("Content-Length: ".filesize($filepath));
Then this is the issue. I don't know if it is with only certain servers, but in my case Internet Explorer couldn't get a filesize so it decided to not download any of the file.
The solution was to simply remove this line and give it no filesize and then the browsers would download the whole file.
Hej hej.
jag har ett script som försöker skicka en zip-fil.
Funkar jättebra med firefox, men sisådär i internet explorer 7.
På en testserver (HTTP) som jag har funkar det jättebra
, men på en annan server (HTTPS) så funkar det inte i internet explorer. Det som händer är att användaren får upp en ruta typ "Filen du försöker är inte tillgänglig" eller nått sånt.
Som sagt, det funkar i firefox både på testservern som kör HTTP och den andra HTTPS-servern, men explorer vill inte ta emot filen när jag testar på HTTPS-servern.
Nån som har någon teori?
<?php
$zipfile = "/home/username/mapp/en-zip-fil-som-finns.zip";
$zipfilename = "hej.zip";
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=" . $zipfilename ."");
header("Content-Length: " . filesize($zipfile));
header("Cache-Control: no-store, no-cache, must-revalidate");
readfile($zipfile);
exit;
?>
