Click here to Skip to main content
15,888,121 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
HI i am storing zip files in a folder in my web application.
how to stop users directly downloading files by typing path in url in the browser

example:- www.temp.com/documents/abc.zip
Posted

You can give permission to folder OR you can do by url rewritting...
 
Share this answer
 
The access to a folder that contains content images sub-folder to the outside world can be given by using the next setting in the web config:

XML
<location path="Content/Images">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>


To deny access to your documents folder you should do in similar way:

XML
<location path="documents">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900