I am using PHPExcel.php and /PHPExcel/Writer/Excel2007.php
in my application , in my code:
$objPHPExcel = new PHPExcel();
//adding values to cells
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('b'.$position,'Total')
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel2007");
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="file.xlsx"');
$objWriter->save('php://output');
But the excel is not downloaded at client side but if we use $objWriter->save($fileName);
it saves the excel in server location successfully .I got following out put in browser
PK2�GG�D�X�[Content_Types].xml��MN�0���"�%nY ��vAa �(0����ؖg�w{&i�@�nbE�{��y��d۸l m������X�(���)���F���;@1_������c)j�x/%��E��y� �QĿi!��K�y3�J<���Z1�0?Y�L%zV c��Ib7�����a/l٥P1:�q�r��j��j0A����u�""���(� ���W�M��)Tj�({ܲ�>�O��,X٭���>B��~���Ӥ6�J=�oBZ����t��X4���Cg�,���QgmrL�ٯc�e���
I am using ubuntu and LibreOffice .Please help me your answer will be appreciate