Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'vendor/autoload.php';
- use PhpOfficePhpSpreadsheetSpreadsheet;
- use PhpOfficePhpSpreadsheetWriterXlsx;
- $spreadsheet = new Spreadsheet();
- $sheet = $spreadsheet->getActiveSheet();
- $sheet->setCellValue('A1', 'Hello World !');
- $writer = new Xlsx($spreadsheet);
- $writer = PhpOfficePhpSpreadsheetIOFactory::createWriter($spreadsheet, 'Xlsx');
- header('Content-Type: application/vnd.ms-excel');
- header('Content-Disposition: attachment; filename="hello_world.xlsx"');
- $writer->save("php://output");
- PHP Warning: ZipArchive::close(): Failure to create temporary file: No such file or directory in /Users/sg/GitWorkingCopies/xxx1/xxx2/library/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php on line 374
- PHP Fatal error: Uncaught exception 'PhpOfficePhpSpreadsheetWriterException' with message 'Could not close zip file php://output.' in /Users/sg/GitWorkingCopies/xxx1/xxx2/library/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:375
Add Comment
Please, Sign In to add comment