fileName = new String(fileName.getBytes(),"ISO8859-1");
OutputStream ouputStream = response.getOutputStream();
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Content-Type","application/force-download");
response.setHeader("Content-Type","application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename="+ fileName +".xls");
wb.write(ouputStream);
ouputStream.flush();
ouputStream.close();
记录以流的形式导出EXCEL跨域问题,项目中其他功能不跨域
最新推荐文章于 2023-06-09 17:35:39 发布