下载文件时,文件名中含有中文的话,浏览器(我用的是IE7)会出现无法下载的情况,解决办法: 使用URL编码进行转码 fileName=response.encodeURL(new String(fileName.getBytes(),"ISO8859_1"));//转码,解决文件名中有中文出现无法下载的情况 response.setHeader("Content-Disposition", "attachment; filename=/""+fileName+"/""); response.setContentType("application/octet-stream"); response.setCharacterEncoding("utf-8");