Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nigel Wilson 944 posts 2076 karma points
    Dec 24, 2010 @ 02:00
    Nigel Wilson
    1

    Access to Path Denied Message

    Hi there

    Have just installed this package but am getting the following error message:

    Access to the path 'C:\Inetpub\wwwroot\TestSite\umbraco\theoutfield\exportmedia\handlers' 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:\Inetpub\wwwroot\TestSite\umbraco\theoutfield\exportmedia\handlers' is denied

    I am running XP Pro / IIS5 and have not experienced such problems with any other packages I have installed.

    I have played around with permissions as much as possible but nothing seems to rectify the problem.

    Can you suggest where things might be going wrong / what I can do to get your package up and running. Would it be worth placing the files in a directory other than /Umbraco and then make changes to your source code and recompile ?

    Thanks and merry Xmas.

    Nigel

    PS Full error below:

    Server Error in '/' Application.
    Access to the path 'C:\Inetpub\wwwroot\TestSite\umbraco\theoutfield\exportmedia\handlers' 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:\Inetpub\wwwroot\TestSite\umbraco\theoutfield\exportmedia\handlers' 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 <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 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:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [UnauthorizedAccessException: Access to the path 'C:\Inetpub\wwwroot\TestSite\umbraco\theoutfield\exportmedia\handlers' is denied.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7716639
       System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
       System.IO.File.Open(String path, FileMode mode) +58
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ParseMedia(HttpContext context, Media media, ZipFile zip, String path) +826
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ProcessRequest(HttpContext context) +370
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


    Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Dec 24, 2010 @ 08:52
    Matt Brailsford
    0

    Hey Nigel

    Hmmmm, I think it's most definatley down to permissions on the handlers folder, it's just a case of working out which user it is. Can you see which user account your ASPNET process is running under, as it looks like it's that account that needs permissions.

    Many thanks

    Matt

  • Nigel Wilson 944 posts 2076 karma points
    Dec 25, 2010 @ 18:05
    Nigel Wilson
    0

    Hi Matt

    I am totally stumped on this one.

    From the Event Viewer log below it appear the user account is "ASPNET"

    Process information: 
        Process ID: 1056
        Process name: aspnet_wp.exe
        Account name: WISA\ASPNET
     
    Request information:
        Request URL: http://wisa/usercontrols/ExportMedia.ashx?id=1121
        Request path: /usercontrols/ExportMedia.ashx
        User host address: 192.168.2.3
        User: 
        Is authenticated: False
        Authentication Type: 
        Thread account name: WISA\ASPNET

    I have altered the source code and moved the .js file to the scripts folder and the .ashx file to the usercontrols folder - really just trying to figure out where things are going wrong. I now get the following

     

    Access to the path 'C:\Inetpub\wwwroot\TestSite\usercontrols' is denied.

    But the site is running fine, it is only the "right click" - "Export Media" that is causing grief.

    I think that XP Pro and not having the granularity of user access on folders is the key problem - I really need a proper web server to facilitate user permissions, etc and to replicate a production environment.

    The one thing that I did notice was in the event log above "Is Authenticated: False" is showing up. I am actively logged in to the admin area so would assume I am authenticated.

    So I think I will refer to your code and try implementing a custom dashboard control - it may be I end up in the same position, but it is worth trying I guess !

    The other aspect is that I want to generate a CSV file (or similar) as part of the download that provides some details on each image within the zip file - it might be best to do this as a separate task for coding simplicities sake !

    Cheers

    Nigel

     

  • Mark 255 posts 612 karma points
    Jun 12, 2014 @ 19:34
    Mark
    0

    We are getting the same issue on Umbraco 4.7.1.1, IIS 7:

    Server Error in '/' Application.


    Access to the path 'C:\Data\Websites\Site34\wwwroot\umbraco\theoutfield\exportmedia\handlers' 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:\Data\Websites\Site34\wwwroot\umbraco\theoutfield\exportmedia\handlers' 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:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [UnauthorizedAccessException: Access to the path 'C:\Data\Websites\Site34\wwwroot\umbraco\theoutfield\exportmedia\handlers' is denied.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
       System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1430
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +208
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +87
       System.IO.File.Open(String path, FileMode mode) +72
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ParseMedia(HttpContext context, Media media, ZipFile zip, String path) +1485
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ParseMedia(HttpContext context, Media media, ZipFile zip, String path) +663
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ParseMedia(HttpContext context, Media media, ZipFile zip, String path) +663
       TheOutfield.UmbExt.ExportMedia.Handlers.ExportMedia.ProcessRequest(HttpContext context) +606
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
    

  • Mark 255 posts 612 karma points
    Jun 12, 2014 @ 19:35
    Mark
    0

    I meant to add. The IIS APPPOOL identity has read / write / execute permissions on that directory (it has it on the entire webroot folder) and the IUSR account has read / execute permissions.

    The folder we're trying to download has many sub folders and files.

  • Mark 255 posts 612 karma points
    Jun 12, 2014 @ 19:53
    Mark
    0

    And to add further, if I try to export a single file / image, it works just fine. Any idea on what the issue could be?

  • Dan 1285 posts 3917 karma points c-trib
    Sep 13, 2015 @ 08:01
    Dan
    0

    An old one, but for the record, I just had this and it turned out to be a media item with no image file. Deleting this empty media node fixed the permission error.

Please Sign in or register to post replies

Write your reply to:

Draft