Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3437580
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:04:58+00:00 2026-05-18T08:04:58+00:00

I have an ASP.NET website which is using a filestream to read in a

  • 0

I have an ASP.NET website which is using a filestream to read in a PDF image from a UNC share on a remote server 2003 box.

i attempt to load the file on the site (which simply embeds a PDF viewer on the site) but when i debug the code, it’s throwing a security exception when i attempt to access the file.

access to _________ path is denied.

So I granted access to the UNC path directory to the ASPNET user.
I also granted access to the user that’s specified for anonymous access in the site itself in IIS. That did not work.

However, I when grant “everybody” access and the file comes through.

So, I need to know WHO is trying to access the file. the assumption is either the ASPNET user or the anonymous user setup in IIS. neither of which is gaining access.

I tried to set up file auditing on the Server 2003 box but it’s not logging a failure in the security event log when I get an access denied exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:04:59+00:00Added an answer on May 18, 2026 at 8:04 am

    System.Security.Principal.WindowsIdentity.GetCurrent().Name will get you the current user name, you could output this user to the screen or to a log file to check who it is.

    The ASPNET user is the windows account that ASP.NET runs under, this is probably not the user who will be accessing the file. You may need to explicitly grant privileges to the anonymous user to access the network (IUSR_MACHINENAME perhaps).

    EDIT:

    As you have enabled anonymous access in IIS, you can force your app to use anonymous access by modifying your web.config to use Forms authentication. Search for ‘

    <authentication mode="Forms" /> 
    

    or

    <authentication mode="Forms">
      <forms loginUrl="~/Login.aspx" timeout="2880"/>
    </authentication>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a asp.net-mvc website with a SQL server backend (using nhibernate for OR
I have an ASP.Net hosted website which displays a list of results as a
I have an existing ASP.NET website which I would like to painlessly add CMS
We have a large ASP.Net website that has a single css stylesheet which is
I have an ASP.NET website and from one of the web pages I need
I'm using LinqToSql classes in an ASP.NET website and let's say I have an
I am building an ASP.Net website, I have a db table which I want
We have hundreds of websites which were developed in asp, .net and java and
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net
I have an ASP.NET website and when I press F5 it automatically attaches to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.