From 353c46886ce89d656837d12289780a9cae955b03 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sun, 9 Feb 2014 15:27:36 +0000 Subject: [PATCH] Extend headers to handle IE 9 problems and IE/SSL caching problems --- Examples/01simple-download-xlsx.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Examples/01simple-download-xlsx.php b/Examples/01simple-download-xlsx.php index c37be63..538888e 100644 --- a/Examples/01simple-download-xlsx.php +++ b/Examples/01simple-download-xlsx.php @@ -75,6 +75,14 @@ $objPHPExcel->setActiveSheetIndex(0); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="01simple.xlsx"'); header('Cache-Control: max-age=0'); +// If you're serving to IE 9, then the following may be needed +header('Cache-Control: max-age=1'); + +// If you're serving to IE over SSL, then the following may be needed +header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past +header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified +header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 +header ('Pragma: public'); // HTTP/1.0 $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter->save('php://output');