ERROR_MESSAGE_MAIN ERROR_MESSAGE_REASON iPad 和 iPhone Safari
ERROR_MESSAGE_MAIN ERROR_MESSAGE_REASON on iPad and iPhone Safari
我的网站有下载功能excelsheet。我将 PHPExcel 库与 Codeigniter 一起使用来创建 .xlsx sheet。除了在 iPad/ iPhone Safari 中,它几乎在任何地方都能正常工作。以下错误覆盖屏幕。
Safari Error Screenshot
我下载文件的代码如下:
ob_end_clean();
$filename='attendance_list.xlsx';
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel2007');
$objWriter->save('php://output');
我正在通过 jquery 和 AJAX 使用此代码调用 php 函数。请给我答案。
而不是:
header('Content-Type: application/vnd.ms-excel');
使用
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
我的网站有下载功能excelsheet。我将 PHPExcel 库与 Codeigniter 一起使用来创建 .xlsx sheet。除了在 iPad/ iPhone Safari 中,它几乎在任何地方都能正常工作。以下错误覆盖屏幕。 Safari Error Screenshot
我下载文件的代码如下:
ob_end_clean();
$filename='attendance_list.xlsx';
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel2007');
$objWriter->save('php://output');
我正在通过 jquery 和 AJAX 使用此代码调用 php 函数。请给我答案。
而不是:
header('Content-Type: application/vnd.ms-excel');
使用
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');