转:https://www.cnblogs.com/hackxiyu/p/9046247.html
使用web下载文件的时候,需要在实例化FileServlet 类的doGet方法里面添加以下设置
resp.setHeader("Content-disposition","attachment;filename"+ URLEncoder.encode(filename));
转:https://www.cnblogs.com/hackxiyu/p/9046247.html
使用web下载文件的时候,需要在实例化FileServlet 类的doGet方法里面添加以下设置
resp.setHeader("Content-disposition","attachment;filename"+ URLEncoder.encode(filename));