首页 >社区问答列表 >导出文件下载,控制台输出乱码

导出文件下载,控制台输出乱码

  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('文件名');

就可以直接保存在根目录,但是不能下载