测试下载文件名为:--@#¥%……&()——+-={}【】:;,..xls

时,服务端报错,IO异常。

原写法:

response.setHeader("Content-Disposition", "attachment; fileName=" + fileName);

解决写法:

response.setHeader("Content-Disposition", "attachment;fileName*=UTF-8''" + UriUtils.encode(fileName, "UTF-8"));

 

相关文章:

  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2022-01-15
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-12-24
  • 2022-12-23
相关资源
相似解决方案