通过获取请求头中字段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); }// 对文件下载乱码问题时候有效,需要验证
时间: 2024-10-18 16:37:06