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
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.
Maybe this will help someone with the same problem. Change Identity for your app pool to LocalSystem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With