经过我测试除了文件名称包含英文逗号谷歌会下载失败外,其它的都没问题了。这个找到解决方法了再补上,先记录一下
String userAgent = request.getHeader("user-agent").toLowerCase();
if (userAgent.contains("msie")) {// IE
try {
fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("%20", "\\+").replaceAll("%28", "\\(")
.replaceAll("%29", "\\)").replaceAll("%3B", ";").replaceAll("%40", "@").replaceAll("%23", "\\#")
.replaceAll("%26", "\\&").replaceAll("%2C", "\\,").replaceAll("%24", "\\$")
.replaceAll("%25", "\\%").replaceAll("%5E", "\\^").replaceAll("%3D", "\\=")
.replaceAll("%2B", "\\+&#