下载路径包含中文

master
e 2018-10-19 23:26:35 +08:00
parent 94c702917a
commit 5604b352ec
1 changed files with 1 additions and 1 deletions

View File

@ -1307,7 +1307,7 @@ public class SystemController extends BaseController {
if("1".equals(flag)){
response.setContentType("application/x-msdownload;charset=utf-8");
String fileName=dbpath.substring(dbpath.lastIndexOf(File.separator)+1);
response.setHeader("Content-disposition", "attachment; filename="+ new String(fileName.getBytes("utf-8"), "ISO8859-1"));
response.setHeader("Content-disposition", "attachment; filename="+ java.net.URLEncoder.encode(fileName, "UTF-8"));
}else{
response.setContentType("image/jpeg;charset=utf-8");
}