每日记录
String headerValue = “attachment;”;
//encodeURIComponent 是自定义utf8 加密方法
headerValue += " filename="" + encodeURIComponent(fileName) +"";";
headerValue += " filename*=utf-8’’" + encodeURIComponent(fileName);
// response.reset();
response.setCharacterEncoding(“utf-8”);
response.setContentType(“application/x-msdownload”);
//这一步必须,否则 返回的文件流中head中‘Content-Disposition’ 无效
response.addHeader(“Access-Control-Expose-Headers”, “Content-Disposition”);
response.addHeader(“Content-disposition”, headerValue +".xlsx");
阿里easyExcel下载文件返回文件名
最新推荐文章于 2024-07-02 10:54:56 发布