@RequestMapping("/download2")
public void download2(String url,HttpServletResponse res,HttpServletRequest req) throws Exception{
//System.out.println(req.getCharacterEncoding());
String fname=new String(url.getBytes("ISO-8859-1"),"UTF-8");
File _file = new File(fname);
String fileName=_file.getName().substring(14);
String agent = (String)req.getHeader("USER-AGENT");
if(agent != null && agent.indexOf("MSIE") == -1) {
fileName = "=?UTF-8?B?" + (new String (Base64.encodeBase64(fileName.getBytes("UTF-8")))) + "?=";
}else {
// IE
fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
}
downFile(res, new FileInputStream(_file),fileName );
}
public void download2(String url,HttpServletResponse res,HttpServletRequest req) throws Exception{
//System.out.println(req.getCharacterEncoding());
String fname=new String(url.getBytes("ISO-8859-1"),"UTF-8");
File _file = new File(fname);
String fileName=_file.getName().substring(14);
String agent = (String)req.getHeader("USER-AGENT");
if(agent != null && agent.indexOf("MSIE") == -1) {
fileName = "=?UTF-8?B?" + (new String (Base64.encodeBase64(fileName.getBytes("UTF-8")))) + "?=";
}else {
// IE
fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
}
downFile(res, new FileInputStream(_file),fileName );
}