String fileName = "你的文件名";
response.setCharacterEncoding("UTF-8");
response.setContentType("APPLICATION/OCTET-STREAM");
fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1");
if(isIE){
// 若是是IE
fileName = URLEncoder.encode(fileName, "ISO8859-1");
}
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Content-Length", "你的文件長度");
bos = new BufferedOutputStream(response.getOutputStream());