解决javaWEB 下载文件中文名称乱码问题

response.setContentType("application/x-msdownload;");

response.setCharacterEncoding("UTF-8");

fileName = URLEncoder.encode(fileName, "UTF-8");

response.addHeader("Content-Disposition", "attachment; filename=\""+ fileName+"\"");

 

你可能感兴趣的:(javaweb)