前言
最近公司有一個作業系統升級案,從 Windows 2003 升級到 Windows 2016。
其中有個部份是從 IIS 那取得 File 。
在測試的過程中,如果檔名中有 + 號,就會回 404 的錯誤。
研究
後來找到 Cannot open a file having special characters in the filename on IIS,原來勾選「允許雙重逸出」這個選項,就可以下載含有 + 號的檔案。
To resolve this issue, follow below instructions:
- in the IIS webserver section, double click the ‘Request Filtering’ icon
- in the ‘File Name Extension’ right click->Edit Feature Settings…’ the file ‘web.config’
- check the option ‘Allow double escaping’ (this option is unchecked by defualt)
- repeat all above 3 steps for the ‘defualt website’ (or whatever you have given the name to your site)
- re-start the IIS
- you should now be able to open up the file name having ‘+’ in its name.
參考資料
Cannot open a file having special characters in the filename on IIS