标签:
通过获取请求头中字段user-agent来判别
if (isIE) { displayFilename = URLEncoder.encode(displayFilename, "UTF-8"); response.setHeader("Content-Disposition", "attachment;filename=\"" + displayFilename + "\""); } else { displayFilename = new String(displayFilename.getBytes("UTF-8"), "ISO8859-1"); response.setHeader("Content-Disposition", "attachment;filename=" + displayFilename); }
// 对文件下载乱码问题时候有效,需要验证
标签:
原文地址:http://www.cnblogs.com/TheoryDance/p/5419285.html