How to provide access only to authenticated user to particular folder in asp.net?

For any other discussion relating to MailEnable.
Post Reply
jubeh
Posts: 1
Joined: Fri Feb 19, 2016 7:21 am

How to provide access only to authenticated user to particular folder in asp.net?

Post by jubeh »

Hi there

I have ASP.NET web application hosted on asphostportal.com

I have to provide access to only authenticated users to a particular list of pdf kept in a folder "PdfFiles" in root directory.

I was trying below configuration settings in web.config, but it did not work, with this setting still this folder is accessible to all the users. I have form authenticated enabled for this site.

Code: Select all

<location path="PdfFiles">
    <system.web>
    <authorization>
      <deny users="?" />
    <allow users="*"/>
    </authorization>
    </system.web>
  </location>
Also I noticed that anonymous authentication was enabled for "PdfFiles" folder in IIS. If I disable this, it does not allow authenticated or anonymous, any of the user to access the pdfs.

So configuration change or IIS change, none of them worked. Can any one help me out on this issue?

Post Reply