Hey guys, I'm new to PHPExcel and fighting for the last hours to get a valid output file to download. I took 01simple.php and 01simple-download-xlsx.php from the docs, the first one generating a valid XLSX on the file system, the second one making
the client download a file which looks ok when opened with a text editor (i.e. starting with the PK mark, no readable error message or anything).
Debugging this problem I merged the two files into one and the last few lines read:
// Redirect output to a client's web browser (Excel2007)
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.ctp', '.xls', __FILE__));
The line with php://output makes the client download a file which Excel complains is corrupted while the line with str_replace works perfectly fine.
I'm looking for ways to get the downloaded file to work. Any suggestions? Could it be encoding? I'm using UTF8 without BOM for all my project files as the website is not displayed correctly otherwise.
On another note: Which directories need read and/or write access for PHPExcel to work when only having downloadable files?