码上敲享录 > javascript入门实例分享 > 导出Excel表,文件名中文乱码

导出Excel表,文件名中文乱码

上一章章节目录下一章 2019-11-15已有2147人阅读 评论(0)

导出Excel表,文件名中文乱码

response.reset();

OutputStream toClient = new BufferedOutputStream(response.getOutputStream());

response.setContentType("application/x-msdownload");

String newName=new String((fileName+".xlsx").getBytes(),"ISO-8859-1");//设置编码

response.addHeader("Content-Disposition", "attachment;filename=" + newName );

response.addHeader("Content-Length", "" + newFile.length());

toClient.write(buffer);

toClient.flush();



向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交