【发布时间】:2022-12-03 16:27:52
【问题描述】:
是否可以在不在 PHPExcel 中创建编写器对象的情况下保存现有文件?
$filename = 'test.xlsx';
$phpExcel = PHPExcel_IOFactory::load($filename);
$phpExcel->save($filename);
【问题讨论】:
标签: phpexcel-1.8.0
是否可以在不在 PHPExcel 中创建编写器对象的情况下保存现有文件?
$filename = 'test.xlsx';
$phpExcel = PHPExcel_IOFactory::load($filename);
$phpExcel->save($filename);
【问题讨论】:
标签: phpexcel-1.8.0
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="filename.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($excel_obj, 'Excel2007');
$objWriter->save('php://output');
【讨论】: