设置响应编码,将文件名用java.net.URLEncoder.encode编码,这样就不会乱码了
java.net.URLEncoder.encode
response.setCharacterEncoding("UTF-8"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName="+java.net.URLEncoder.encode(name, "UTF-8"));
原文地址:http://blog.csdn.net/u012169499/article/details/46651095