response.setCharacterEncoding("GBK");
response.setContentType("application/x-download;charset=GBK");//设置为下载application/x-download
String filenamedisplay = URLEncoder.encode(filenamedisplay, "UTF-8");//文件编码问题 注意修改
response.addHeader("Content-Disposition", "attachment;filename="
+ filenamedisplay);response.addHeader("Content-Disposition", "attachment;filename="
+ filenamedisplay);