Guys, tell me, please.
I work in PHPExcel and just can’t save the file in the browser. Those. I process the file in php I have
<a href="Load.php" class="button24">Сформировать отчет</a> But the file load.php (Took from the example PHPExcel)
<?php // Redirect output to a client's web browser (Excel2007) header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="simple.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 MYH: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'); exit; The file is called simple.xlsx, the one that needs to be downloaded via the browser.
It is formed normally, etc.
When you try to run - displays hieroglyphs of the type
PK zM! d [Content_Types].xml͖_O 0 K_ V@E4 D D c [ jL 5 z I;o qQC D b! ] i$L 3 2n oT :Z h [ 4 ი ] yN ,ە > > j -' V ) # EF^6 n 8q"K H >_ׄ eƏ <⇄ Ud v T PK zMY %$xl/_rels/workbook.xml.rels Kn 0 }Oa; *& R -= C mԆH ʚA Ӱ 9 RU l8 O c D $r ! ?c/ c n4ąHá v| Ԕ- DjD J ºR7t I4H 8N g@~ I } b ?٪ U 6 7FPc I!t ù \ % [w/ s EW Ջ 71o 0 %1J L h/ 7 lc& Y 0 l| Can you please tell me how to save a file through a browser in PHPExcel? If there is such an opportunity, still tell me, how can it be made immediately and to print by another button?
<a>to the file with thedownloadattribute - n.osennij