How to download a file with plus symbol(+) filename in IIS?

How to download a file with plus symbol(+) filename in IIS?

Original post link:http://www.javashuo.com/article/p-fglyqafz-ha.htmlhtml

Today I get a ticket with our client that they could not download a file with plus symbol(+) filename, such as the filename is a+b.xls.
I have a try and get the 404 code as below.
iis_file_404web

Firstly, I consider if the file is deleted on the server by someone, so I remote to the server and have a check. But...all going well. The file is here.
Then I search if someone has had this problem on the Internet. A lot of answers say that + is a specific symbol in browser. It should be transcoded into %2B.
So I add the js code as below and try again.api

fileName=fileName.replaceAll("\\+","%2B");
window.location.href = conf.webAPIRoot + fileName;

But...it doesn't work for me.ide

In another answer found in https://forums.iis.net/t/1226370.aspx. It should be set in IIS. After the setting, I try again and it works for me.post

Request Filtering -> Edit Feature Settings -> Allow Double Escapingthis

iis_file_featureview

iis_file_requestfiltering

相關文章
相關標籤/搜索