Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS 8.5 Access to the path is denied

The program will upload a picture and saved it in a virtual directory folder. I encounter this error and I follow the suggestions as suggested in stackOverview and still cannot resolve the issues.

The message simply says the IIS 8.5 doesn't have permission to access to the folder and save a picture in that particular folder. So,I give full permission to the following roles

  1. Everyone - Full Control
  2. IUSR - Full Control
  3. Network Service - Full Control
  4. Users - Full Control
  5. Guest - Full Control![enter image description here][1]
  6. IIS_IUSR - FUll Control
  7. ANONYMOUS LOGIN - Full Control
  8. DefaultAppPool - Fullcontrol

It is confirmed that Anonymous Authentication is enabled and the specific user is IUSR. ![enter image description here][2]

The detail error message is as below. Any advise is greatly appreciated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 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 and IIS 7, and the configured application pool identity on IIS 7.5) 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 File 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.

[UnauthorizedAccessException: Access to the path is denied.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +13946990 System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost) +350 TakePicture.files_FileUploaded(Object sender, FileUploadedEventArgs e) in C:\Users\sam\Documents\Visual Studio 2013\Projects\TownCouncilMobile\ReportDefect2\TakePicture.aspx.vb:45 Telerik.Web.UI.RadAsyncUpload.RaisePostDataChangedEvent() +199 System.Web.UI.Page.RaiseChangedEvents() +333 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3572

It has been 3 days as I am still stuck in this problem.

like image 835
Sam Liaw Avatar asked Jan 26 '26 18:01

Sam Liaw


1 Answers

Maybe this will help someone with the same problem. Change Identity for your app pool to LocalSystem.

like image 59
Ioana Marcu Avatar answered Jan 28 '26 12:01

Ioana Marcu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!