IIS Directory browsing diable file access directly

Kahreaplereoqt

New Member
I have a website hosted in IIS with directory browsing disabled. The website is developed in ASP.Net, MySql and C#. For e.g., If i type www.mysite.com/LoremIpsums/ then it shows 403 error. However if i type, www.mysite.com/LoremIpsums/IpsumLorem.pdf it shows/downloads the the PDF file. How to disable this?I have searched on net and found sth like\[code\] <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" roles="Administrators" /> </authorization>\[/code\]If i use this in web.config, the user wont be able to download the pdf file even after logging in. So how to achieve file access only for logged in users. (Either using C# code or IIS Settings)?
 
Back
Top