Servlet实现下载 firefox下文件名有空格时,文件名会被截断 问题解决办法

之前是用:

response.setHeader("Content-disposition", "attachment;filename=" + filedownload );


修改如下(把filename用双引号引起来)就解决了:

response.setHeader("Content-disposition", "attachment;filename=\"" + filedownload + "\"");


你可能感兴趣的:(servlet,firefox)