String fileName = "带空格的文件名.xlsx";
fileName = URLEncoder.encode(fileName, "UTF-8");
fileName=fileName.replaceAll("\\+","%20");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName);
转载于:https://my.oschina.net/u/4058227/blog/3025169