//设置内容内容型应用下载,设置字符集
response.setContentType("application/octet-stream");
//设置文件名
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName ,"UTF-8"));
设置HttpServletResponse,浏览器输入下载地址进行测试
//设置内容内容型应用下载,设置字符集
response.setContentType("application/octet-stream");
//设置文件名
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName ,"UTF-8"));
设置HttpServletResponse,浏览器输入下载地址进行测试