?
/** * deal with the fileName encode in the different browsers * @param request * @param fileName * @return * @throws UnsupportedEncodingException */ private String encodeFileName(HttpServletRequest request, String fileName) throws UnsupportedEncodingException { String agent = request.getHeader("USER-AGENT"); if (null != agent && -1 != agent.indexOf("MSIE")) { return URLEncoder.encode(fileName, "UTF8").replace("+","%20"); } else if (null != agent && -1 != agent.indexOf("Mozilla")) { return "=?UTF-8?B?" + (new String(Base64.encodeBase64(fileName .getBytes("UTF-8")))) + "?="; } else { return fileName; } }
?
?
?