Download file in IE from HTTPS
Posted: Sat Aug 21, 2010 1:53 pm
I am creating excel files on the fly from my code and then I give a "download" button to users to download the newly created excel file. Everything works fine on all the modern browsers except IE. It gives an error message that "Unable to open this internet site. The requested site is either unavailable or cannot be found. Please try again later"
I have googled this issue and it seems like that IE throws this error for HTTPS (SSL) URLs. microsoft support page says that it can happen if you have any of the following headers:
I have googled this issue and it seems like that IE throws this error for HTTPS (SSL) URLs. microsoft support page says that it can happen if you have any of the following headers:
In my code I don't have these headers, but when I print the headers from PHP these get included automatically, I also tried to use unset() to get rid of them but still no luck, any help is appreciated. Here is my code below:Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
Code: Select all
header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/vnd.ms-excel");
echo $data;