文章詳情頁
導出文件下載,控制臺輸出亂碼
瀏覽:95日期:2022-06-04 10:33:47
問題描述
header("Pragma: public");header("Expires: 0");header("Cache-Control:must-revalidate, post-check=0, pre-check=0");header("Content-Type:application/force-download");header("Content-Type:application/vnd.ms-execl");header("Content-Type:application/octet-stream");header("Content-Type:application/download");;header('Content-Disposition:attachment;filename='.$fileName.'');header("Content-Transfer-Encoding:binary");//輸出$writer = IOFactory::createWriter($spreadsheet,'Xlsx');$writer->save('php://output');
但是如果
$writer->save('文件名');
就可以直接保存在根目錄,但是不能下載
問題解答
回答1:代碼以及錯誤信息, 截圖發(fā)出來
上一條:訪問是否涉及路由下一條:php如何單獨提取出不滿足條件的字符串
排行榜

熱門標簽