本文介绍了如何在 Content-Disposition 标头中设置包含空格的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这段代码:
resp.addHeader("Content-Disposition", "inline; filename=" + fileName);当文件名为a_b_c.doc"或abc.doc"时,下载文件的名称显示正确.但是,当文件名为a b c .doc"时,下载文件的名称仅为a".
When the file name is "a_b_c.doc" or "abc.doc" the name of the downloaded file is displayed correctly. However, when the file name is "a b c .doc" the name of the downloaded file is only "a".
我们如何解决这个问题?
How can we solve this?
推荐答案使用引号:
resp.addHeader("Content-Disposition", "inline; filename="" + fileName + """);更多推荐
如何在 Content
发布评论