I am using PHPExcel to write and download an Excel file to the user. This works fine in Firefox and Chrome but fails in IE.
here is the relevant code:
$objWriter = PHPExcel_IOFactory::createWriter($xls, 'Excel2007');
header_remove();
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="01simple.xlsx"');
header('Cache-Control: max-age=1');
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: '); // HTTP/1.0
$objWriter->save('php://output');
exit;
But this causes a dialog to pop (open, save as, cancel). If I select Open, an error displays saying could not open http://path_to_api
. If I click "Save As", it downloads as "0 (5).s5osyo0.partial"
Anyone have any suggestions on why this is happening?