普元AppServer 下载中文名文件时,文件名丢失
【问题】
业务应用中使用JAVA进行附件下载配置,代码示例如下:
response.setHeader(
"Content-Disposition"
,
"attachment; filename="
+
new
String(fileName.getBytes(
"utf-8"
),
"ISO-8859-1"
));
在浏览器中进行资源下载,此时如果文件名包含中文,下载后文件的中文名丢失。
【解答】
修改文件名处理逻辑,改为:
response.setHeader(
"Content-Disposition"
,
"attachment; filename="
+
new
String(URLEncoder.encode(fileName,
"UTF-8"
));
详细咨询请联系普元售后:cservice@primeton.com
原文链接:http://doc.primeton.com/pages/viewpage.action?pageId=46792794