response.setContentType("application/OCTET-STREAM;charset=UTF-8");
// 把utf-8改成gbk,解决中文文件名乱码 chenys 2013.08.29
response.setHeader("Content-disposition", "attachment; filename=" + new String(path.getBytes("gbk"), "ISO8859-1"));
//解决页乱码
String userName = java.net.URLDecoder.decode(request.getParameter("userName"), "UTF-8");