Monday, December 13, 2010

How to Restrict Download of Specified File Types in Asp.Net.

In this post i will show you how to restrict your web app so that .txt (whatever file extensions you want ) files can not be downloaded.

Open your web.config file and register following setting in your web.config


<system.web>
<httpHandlers>
<add verb=”*” path=”*.txt” type=”System.Web.HttpForbiddenHandler” />
</httpHandlers>
</system.web>

0 comments:

Post a Comment