In this post we will secure image /files from being accessed by anonymous users.
In ASP.net 2.0 web.config we will add 6 lines of code.
Scenario: I have stored all images in images folder found at the root. I will add below web.config file to my images folder.
It will let the users who are in role Editor of site to access and it will ban anonymous users .
Eventually, whatever you store inside the images folder will not be accesible to users who are not in role Editor.
To see how we can use asp.net membershipprovider based model please refer http://revenmerchantservices.com/page/ASpnet-20-step-by-step-Membership-Provider-.aspx