Re: Security problem when dynamically creating directories

From: Eran Kampf (eran_at_ekampf.com)
Date: 10/14/04


Date: Thu, 14 Oct 2004 20:35:38 +0200

The path I am trying to create is correct.
I checked the knowledge base and I think the problem is due to the fact that
D is a mapped network drive while the asp.net worker process is a local user
that has no network access and thus cannot access the network drive.

If that is true then
1. How creating a directory with old ASP FileSystem object works fine?
2. How come creating\reading\writing files in existing directories work
fine?

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:Onk5HPesEHA.3336@tk2msftngp13.phx.gbl...
> Eran,
>
> Server.MapPath("/") will return the path to the site root, which is not
> necessarily the root folder of your application. You should have better
> luck with Server.MapPath(null). In addition, the value returned may not
> have a trailing backslash. To ensure proper path generation, use
> Path.Combine rather than simple concatenation. e.g.:
> System.IO.Path.Combine(Server.MapPath(null), "test").
>
> If the above still doesn't work, have you tried simply writing the output
> from Server.MapPath to an ASPX page so that you can view the value? Is
> the returned value a path on which the execution context user should have
> adequate permissions to perform the operations that you are attempting?
>
> HTH,
> Nicole
>
>
>
> "Eran Kampf" <eran@ekampf.com> wrote in message
> news:%23SFw73VsEHA.1520@TK2MSFTNGP11.phx.gbl...
>>I am trying to dynamically create directories in my ASP.NET application (I
>> am using Server.MapPath("/")+"test" as the folder)
>> and I am getting a DirectoryNotFoundException saying "Could not find a
>> part
>> of the path "D:\".
>> My site is hosted on a public ISP that for obvious security reasons does
>> not
>> allow my read access above my wwwroot folder which seems to be a problem
>> when trying to create directories...
>>
>> Is there any way to solve this?
>>
>> --
>> Eran Kampf
>> blog: http://www.ekampf.com/blog
>> Sharp3D.Math: http://www.ekampf.com/Sharp3D.Math/
>>
>
>



Relevant Pages

  • Re: Security problem when dynamically creating directories
    ... How come creating\reading\writing files in existing directories work ... > necessarily the root folder of your application. ... > the returned value a path on which the execution context user should have ... >> Eran Kampf ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Security problem when dynamically creating directories
    ... How come creating\reading\writing files in existing directories work ... > necessarily the root folder of your application. ... > the returned value a path on which the execution context user should have ... >> Eran Kampf ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast