搜索

首页  >  问答  >  正文

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

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

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

夏日飞霜夏日飞霜1581 天前1165

全部回复(1)我来回复

  • 天蓬老师

    天蓬老师2020-11-12 14:16:05

    代码以及错误信息, 截图发出来

    回复
    0
  • 取消回复