I've been working on a file distribution site. I've been doing all my testing with Mozilla. From what I could tell, it was working fine.
However, after trying it with IE, it seems like IE is not reading the headers correctly....here's the code that I'm using:
if ($action == "dl") {
// send the necessary headers
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$file_name");
header("Content-length: " . filesize($file_path.$file_name));
header("Content-transfer-encoding: binary");
// open the file for reading and start dumping it to the browser
if (file_exists($file_path.$file_name)) {
$fp = fopen($file_path.$file_name, "r");
fpassthru($fp);
// close the file
fclose($fp);
}
}
When I click the download link from Mozilla, it picks up the correct filesize, filename, etc and I am able to download the file with no problems. However when I click the download link from IE, it thinks the filename is the name of the php script.
Any ideas?
Thanks!