I thought I would contribute a solution for once.
We have a standard SUSE LAMP (Linux Apache Mysql PHP) server running
some custom apps, of which one component is dumping reports out to
excel. We are running this with https and all was good for a few
months. IE6 and Firefox worked fine. One day around the end of July
2005, IE6 stops doing the excel part.. Excel errors out with a "Could
not open 'https://blah.com?report .php'" . Firefox continues to work
fine. It turns out something has changed in an IE update from
Microsoft that breaks the old method we employed to launch excel and
feed it the data stream. This php code below contains the new headers
which now make this work for us again. Firefox continues to work
flawlessly with the new headers also!
<?
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=report .xls");
header('Cache-Control: private, must-revalidate');
header('Pragma: private'); // allow private caching
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
session_cache_l imiter("private , must-revalidate"); // allow private
?>
BTW, we are using PHP 4.x and apache 1.3.x
I hope this helps someone else, as it puzzled us for a while.
We have a standard SUSE LAMP (Linux Apache Mysql PHP) server running
some custom apps, of which one component is dumping reports out to
excel. We are running this with https and all was good for a few
months. IE6 and Firefox worked fine. One day around the end of July
2005, IE6 stops doing the excel part.. Excel errors out with a "Could
not open 'https://blah.com?report .php'" . Firefox continues to work
fine. It turns out something has changed in an IE update from
Microsoft that breaks the old method we employed to launch excel and
feed it the data stream. This php code below contains the new headers
which now make this work for us again. Firefox continues to work
flawlessly with the new headers also!
<?
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=report .xls");
header('Cache-Control: private, must-revalidate');
header('Pragma: private'); // allow private caching
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
session_cache_l imiter("private , must-revalidate"); // allow private
?>
BTW, we are using PHP 4.x and apache 1.3.x
I hope this helps someone else, as it puzzled us for a while.
Comment