ASP.NET 2.0 Write File (IIS 6.0/Windows 2003)

Discussion in 'ASP .Net' started by Henok Girma, Apr 16, 2008.

  1. Henok Girma

    Henok Girma Guest

    Hello,
    I wanted to write to a folder from my ASP.NET web app, but i get

    Access to the path 'C:\Inetpub\wwwroot\Test\Logs\test.log' is denied. at
    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at
    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) at System.IO.FileStream..ctor(String path, FileMode mode,

    here is what i did

    i created a Virtual Directory Test
    under it there is a folder Logs
    i set the propery from IIS of the logs folder to 'write'

    i changed the security permission of the folder from windows explorer(right
    click|properties)
    and added the user IUSR_<MachineName> and ASPNET user.. i gave both users
    FULL ACCESS, yet i am still not able to write to that folder.

    am I missing something?

    any help is greatly appreciated
     
    Henok Girma, Apr 16, 2008
    #1
    1. Advertising

  2. Henok Girma

    Henok Girma Guest

    ok, i got it.. i had add to the user IIS_WPG..



    "Henok Girma" <> wrote in message
    news:...
    > Hello,
    > I wanted to write to a folder from my ASP.NET web app, but i get
    >
    > Access to the path 'C:\Inetpub\wwwroot\Test\Logs\test.log' is denied. at
    > System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at
    > 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) at System.IO.FileStream..ctor(String path, FileMode mode,
    >
    > here is what i did
    >
    > i created a Virtual Directory Test
    > under it there is a folder Logs
    > i set the propery from IIS of the logs folder to 'write'
    >
    > i changed the security permission of the folder from windows
    > explorer(right click|properties)
    > and added the user IUSR_<MachineName> and ASPNET user.. i gave both users
    > FULL ACCESS, yet i am still not able to write to that folder.
    >
    > am I missing something?
    >
    > any help is greatly appreciated
     
    Henok Girma, Apr 16, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Barlow
    Replies:
    2
    Views:
    530
    Todd Barlow
    Jul 8, 2003
  2. Oney
    Replies:
    1
    Views:
    1,540
    John Oakes
    Feb 16, 2004
  3. Replies:
    0
    Views:
    893
  4. Raj
    Replies:
    2
    Views:
    160
    Aaron Bertrand [MVP]
    Apr 14, 2004
  5. SKHM1
    Replies:
    1
    Views:
    203
Loading...

Share This Page