PHP_XLSXWriter
PHP_XLSXWriter copied to clipboard
Generated XLSX File from MIME-TYPE application/octet-stream
Hi guys, i wrote an excel (xlsx) export and use this library. For imports, i will check the mime type of every uploaded file. But the mime-type check of this xlsx file is from type application/octet-stream.
I have try it with some header information, but with the same result.
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate'); header('Pragma: public');
I use PHP in Version 5.6.x.
$writer = new Efs_Xlsx_Writer(); $writer->setAuthor('Example author'); $writer->writeSheet($data, "Sheet name", $headers); $writer->writeToFile('myfile.xlsx');
Just try to use: //$writer->writeToFile('myfile.xlsx'); $writer->writeToStdOut(); $writer->writeToString;