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

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?

Postby jubeh » Tue Jun 07, 2016 6:48 am

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?

Who is online

Users browsing this forum: No registered users and 5 guests