Folder access by ASP.Net application

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Folder access by ASP.Net application

    I have an ASP.NET application that needs to read/write from to the IIS
    application directory and its subdirectories. The application is configured
    to use form authentication and thus it has the following entries in
    web.config:
    <authentication mode="Forms">
    <forms name="CommerceAuth" loginUrl="login.aspx"
    protection="All" path="/" />
    </authentication>
    <authorization><deny users="?" /><allow users ="*"
    /></authorization>

    Now the application runs OK on my dev box. The ASP.Net application is able
    to create file in IIS application folder and its subdirectory. However, once
    uploaded to my web host, the code that generates file on the web server IIS
    folder throws exception that essentially states that access to the directory
    is denied.

    Now my suspicion is that it has something to do with security permission
    granted to accounts used by IIS and ASP.Net. If I understand the IIS/ASP.Net
    architecture correctly, all anonymous requests are run in the context of
    IUSR* (where * is the machine name). It is then handed off to either ASPNET
    account (if IIS 5.x) or the configured worker pool account for ASP.Net
    process on IIS6 (if configured or default back to ASPNET account). Thus, if
    ASPNET account (or the worker pool account) has the necessary privilege to
    write to the particular IIS folder, then the application should be able to
    create a file in that folder. Otherwise, access would be denied.

    Can someone confirm or clarify if my understanding is correct?

    Thanks


    CW Guest

  2. Similar Questions and Discussions

    1. Can I allow access to one file within a folder, but notthe whole folder
      I want to allow access for users to edit only specific file within a folder. Can I do this Also, since I am just starting to use this on a new...
    2. Application Pools folder is missing
      OS is Windows 2003 Server IIS is version 6 In IIS when I look under the <machine_name>(local computer), I do not have the Application Pools...
    3. Web Application folder path
      Anyone know how to get a path to your web application's folder at design time? I've tried using MapPathSecure in the OnInit call, but no luck.
    4. What issue will HIT me hard when I convert an Access 2002 MDE application to Web Application?
      Hi All, Current Access 2002 MDE application: - has no tier - has neither business object nor any kind of object (Except MS Form object and...
    5. Application folder not seeing namespace of the main application
      hi I have a website (localhost namespace : "whatever") that has a secure application folder ( called secure with a namespace : "Secure") I...
  3. #2

    Default Re: Folder access by ASP.Net application

    Hi CW,

    I would suggest you to check the security settings for the root folder
    under which you are creating the folders and files from your
    code.

    You should have the ASPNET user added to the group and should have write
    permissions.

    Hope this helps you.

    Thanks
    Raghavendra
    "CW" <CW@nospam.com> wrote in message
    news:OBBotWpkEHA.536@TK2MSFTNGP11.phx.gbl...
    > I have an ASP.NET application that needs to read/write from to the IIS
    > application directory and its subdirectories. The application is
    configured
    > to use form authentication and thus it has the following entries in
    > web.config:
    > <authentication mode="Forms">
    > <forms name="CommerceAuth" loginUrl="login.aspx"
    > protection="All" path="/" />
    > </authentication>
    > <authorization><deny users="?" /><allow users ="*"
    > /></authorization>
    >
    > Now the application runs OK on my dev box. The ASP.Net application is able
    > to create file in IIS application folder and its subdirectory. However,
    once
    > uploaded to my web host, the code that generates file on the web server
    IIS
    > folder throws exception that essentially states that access to the
    directory
    > is denied.
    >
    > Now my suspicion is that it has something to do with security permission
    > granted to accounts used by IIS and ASP.Net. If I understand the
    IIS/ASP.Net
    > architecture correctly, all anonymous requests are run in the context of
    > IUSR* (where * is the machine name). It is then handed off to either
    ASPNET
    > account (if IIS 5.x) or the configured worker pool account for ASP.Net
    > process on IIS6 (if configured or default back to ASPNET account). Thus,
    if
    > ASPNET account (or the worker pool account) has the necessary privilege
    to
    > write to the particular IIS folder, then the application should be able to
    > create a file in that folder. Otherwise, access would be denied.
    >
    > Can someone confirm or clarify if my understanding is correct?
    >
    > Thanks
    >
    >

    Raghavendra T V Guest

  4. #3

    Default RE: Folder access by ASP.Net application

    You understanding is right. When working with Form authentication, ASP.NET
    application will use the account "ASPNET" (IIS 5) or "Network service" (IIS
    6.0 ) to access the resource like file system or database. It seems the
    account on your web server didn't have enough permission to create files on
    the particular folder. You may contact the server's administrator for this.

    Luke

    [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139