IIS 7 and Above
Configuration & Scripting
How to avoid .txt, .xml file downloading in IIS.
Last post Jun 14, 2018 03:11 AM by deepakpanchal10
Jun 13, 2018 11:39 AM|rkganapathy|LINK
After deploying my project to IIS its able download and view txt and xml file extension using address bar.
I am not have rights to access IIS. Please suggest any option to overwrite this setting using web,config.
Jun 13, 2018 09:39 PM|lextm|LINK
I am not have rights to access IIS.
Can you explain more about that? Certain IIS features like request filtering do require access to applicationHost.config.
Jun 14, 2018 03:11 AM|deepakpanchal10|LINK
You can try to use rule like below.
<remove users="*" roles="" verbs="" />
<add accessType="Allow" roles="Administrators" />
You can also try to refer request filtering example below.
<filteringRule name="Block rule" scanUrl="false" scanQueryString="false" scanAllRaw="false">
<add requestHeader="User-agent" />
<add fileExtension=".txt" />
<add fileExtension=".xml" />
<add string="leech-bot" />
File Name Extensions for Filtering Rules <appliesTo>