I have been using Firefox as my default browser for months now, so I discovered several sites that I have programmed that aren't working in IE.
I have a "Create Spreadsheet" option on several pages of this project where it writes a .csv file to the server. Then, it provides a link like this:
https://nowhere.com/download/download.php?file=/hsphere/local/home/nowhere.com/manage/downloads/order_spreadsheet.csv
Then, the code in my download.php file is this:
$shortname=basename($_GET["file"]);
$size=filesize($_GET["file"]);
//set header
header("Content-Type: application/save");
header("Content-Length: $size");
header("Content-Disposition: attachment; filename=$shortname");
header("Content-Transfer-Encoding: binary");
//start transfer
$handler=fopen("".$_GET["file"]."","r");
fpassthru($handler);
This works PERFECTLY in Firefox, but when I click the link in IE, I see the download box in the background, but an error window on top of it which says:
Internet Explorer cannot download order_spreadsheet.csv from ...nowhere.com
Internet Exploreer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
But the file is there on the server and this same page works fine in Firefox. Is there another header variable or something that I need to add for IE?