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 6703503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:10:44+00:00 2026-05-26T07:10:44+00:00

I am currently creating a folder and writing a file to the folder that

  • 0

I am currently creating a folder and writing a file to the folder that need to be create on a file server that we have. When i do a localhost test, it work perfectly but when i access the website from outside the localhost and from another pc. It said that

System.UnauthorizedAccessException: Access to the path ‘My File Server
URL’ is denied

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request
identity. ASP.NET has a base process identity (typically
{MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
the application is not impersonating. If the application is
impersonating via , the identity will be
the anonymous user (typically IUSR_MACHINENAME) or the authenticated
request user.

To grant ASP.NET access to a file, right-click the file in Explorer,
choose “Properties” and select the Security tab. Click “Add” to add
the appropriate user or group. Highlight the ASP.NET account, and
check the boxes for the desired access.

But the thing is that i have already set the identity impersonate=”true” in the web.config and it still didn’t work. My web server is running on Winder Server 2003 and IIS 6

Any advice and help will be deeply appreciated

Thanks
Brandon

  • 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-26T07:10:45+00:00Added an answer on May 26, 2026 at 7:10 am

    Hi Guys i manage to find the solution to it
    If u are creating a folder, using this code before file or folder creation

    WindowsImpersonationContext ctx = WindowsIdentity.Impersonate(IntPtr.Zero);
    // Insert the create code here
    ctx.Undo();
    

    Well i do not know if this is the best solution. if anyone know the downside or implication of this code please share and comment.

    no harm knowing more

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating an explicit reference to this in the outer class so that
I'm currently creating an application for a customer that will allow them to automatically
I am currently creating an e-commerce site using C# ASP.NET MVC and have just
In case something goes wrong in creating a file, I've been writing to a
I am currently creating a console application which is reading from a folder which
I need to customize iReport sources.. (not creating plugin) Currently i am using iReport
The shop that I work at basically has developers creating controls and a backend
Im currently creating a uninstallation application which deletes the application folder. The problem is
We have a setup project that currently adds Project Output's from different visual studio
Possible Duplicate: file_put_contents permission denied I have recently transferred server, and it seems that

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.