Server Error in '/' Application.

Access to the path 'C:\InsiteCreation\resources_secure\files\338\1_IMG_3732.JPG' is denied.

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 'C:\InsiteCreation\resources_secure\files\338\1_IMG_3732.JPG' 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 <identity impersonate="true"/>, 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.

Source Error:


Line 167:                context.Response.Clear()
Line 168:                context.Response.AddHeader("content-disposition", "attachment;filename=" & sName)
Line 169:                context.Response.AddHeader("Content-Length", infoFile.Length.ToString)
Line 170:                context.Response.ContentType = "application/octet-stream"
Line 171:                'fix to allow big files    

Source File: d:\web\localuser\hospicesydvestjy.dk\public_html\systems\file_download.ashx    Line: 169

Stack Trace:


[UnauthorizedAccessException: Access to the path 'C:\InsiteCreation\resources_secure\files\338\1_IMG_3732.JPG' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +12797107
   System.IO.FileInfo.get_Length() +13062324
   FileDownload.ProcessRequest(HttpContext context) in d:\web\localuser\hospicesydvestjy.dk\public_html\systems\file_download.ashx:169
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0