IIS 7 and Above
How to block our root folder EXE or Other extension file download fro...
Last post Jun 11, 2019 02:40 AM by Jalpa Panchal
Jun 10, 2019 09:38 AM|jignesh.panchal1|LINK
We are using IIS 8 on Windows Server 2012 R2 Standard
we want to block some file extension to download from client side,
so we are currently using webDev like below:
<add fileExtension=".exe" allowed="false" />
Is there any other best method for this?
webDev will support in future version of IIS also?
Jun 11, 2019 02:40 AM|Jalpa Panchal|LINK
Hi Jignesh Panchal,
You could try to add below code in web.config file:
<add path="./Files/*.txt" verb="*" type="System.Web.HttpForbiddenHandler" name="TXT" />
Note: this is for text file you could modify as per your requirement.
In IIS there is no setting to restrict file. you could full fill your requirement by put some coding in your application or site.
The request filter module scans incoming requests and rejects requests that are unwanted based upon the rules that you set up.
You could refer below article for more detail:
Configure Request Filtering in IIS