java 判断浏览器
String agent
agent = request.getHeader("USER-AGENT");
log.debug("--------------------agent==========" + agent);
if (null != agent && -1 != agent.indexOf("MSIE")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + java.net.URLEncoder.encode(fileName, "UTF-8").replace("+", " ") + "\"");
} else if (null != agent && -1 != agent.indexOf("Firefox")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "iso8859-1") + "\"");
} else if (null != agent && -1 != agent.indexOf("Safari")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + java.net.URLEncoder.encode(fileName, "UTF-8").replace("+", " ") + "\"");
} else {
}
agent = request.getHeader("USER-AGENT");
log.debug("--------------------agent==========" + agent);
if (null != agent && -1 != agent.indexOf("MSIE")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + java.net.URLEncoder.encode(fileName, "UTF-8").replace("+", " ") + "\"");
} else if (null != agent && -1 != agent.indexOf("Firefox")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "iso8859-1") + "\"");
} else if (null != agent && -1 != agent.indexOf("Safari")) {
response.addHeader("Content-Disposition","attachment; filename=\"" + java.net.URLEncoder.encode(fileName, "UTF-8").replace("+", " ") + "\"");
} else {
}