Write Permissions on Application folder

Discussion in 'ASP.NET 2.0' started by glowshotcom, Apr 22, 2007.

  1. Hello.

    I need to write files from my asp.net 2.0 page. I thought I should have access to the folder where my application files are, but couldn't make it work.

    If i try to write using:

    FileStream writer = File.OpenWrite(Server.MapPath('file.txt'));

    then i get the following error message:

    Access to the path 'c:\windows\system32\inetsrv\file.txt' is denied.

    Any ideas?

    Thanks in advance.
     
  2. Server.MapPath('file.txt') should not even resolve to that path.Are you having this issue locally ?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Please issue a helpdesk ticket to our technical support from your control panel,because I dont see any reason for Server.Mappath(...) should resolve to 'c:\windows\system32\...'

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Locally it maps to C:\inetpub\wwwroot\TestApp\file.txt', which is fine, that's why I don't understand why it it's trying to open the file in c:\windows\system32\inetsrv\file.txt when I try in the hosted environment.

    Is there anything I need to setup in my app / DiscountASP.net control panel ?

    Thanks.
     

Share This Page