Problem creating directories through asp.net

Discussion in 'ASP .Net' started by Stimp, Mar 8, 2006.

  1. Stimp

    Stimp Guest

    When a user registers with my site, I create a separate folder for them
    (for uploading photos, etc).

    The code for this has been working fine for 1 year, but over the past 2
    weeks it has been falling down on the 'CreateDirectory' function.

    The error I'm getting is:

    "Could not find a part of the path "E:\"."


    Here's the code where the site falls down:

    Directory.CreateDirectory(Server.MapPath("members\" & sUserName.ToLower))


    My host provider has no idea why it is happening.. what could be the
    reason?

    Thanks,
    Peter
    --

    fiddlewidawiddum
     
    Stimp, Mar 8, 2006
    #1
    1. Advertising

  2. Peter,

    Must be they changed something in security. Now you are in trouble of
    finding what do you have change to accomodate their change.

    Eliyahu

    "Stimp" <> wrote in message
    news:...
    > When a user registers with my site, I create a separate folder for them
    > (for uploading photos, etc).
    >
    > The code for this has been working fine for 1 year, but over the past 2
    > weeks it has been falling down on the 'CreateDirectory' function.
    >
    > The error I'm getting is:
    >
    > "Could not find a part of the path "E:\"."
    >
    >
    > Here's the code where the site falls down:
    >
    > Directory.CreateDirectory(Server.MapPath("members\" & sUserName.ToLower))
    >
    >
    > My host provider has no idea why it is happening.. what could be the
    > reason?
    >
    > Thanks,
    > Peter
    > --
    >
    > fiddlewidawiddum
     
    Eliyahu Goldin, Mar 8, 2006
    #2
    1. Advertising

  3. Stimp

    Hans Kesting Guest

    Re: =?UTF-8?B?UHJvYmxlbSBjcmVhdGluZyBkaXJlY3RvcmllcyB0aHJvdWdoIGFz?==?UTF-8?B?cC5uZXQ=?=

    > When a user registers with my site, I create a separate folder for them
    > (for uploading photos, etc).
    >
    > The code for this has been working fine for 1 year, but over the past 2
    > weeks it has been falling down on the 'CreateDirectory' function.
    >
    > The error I'm getting is:
    >
    > "Could not find a part of the path "E:\"."
    >
    >
    > Here's the code where the site falls down:
    >
    > Directory.CreateDirectory(Server.MapPath("members\" & sUserName.ToLower))
    >
    >
    > My host provider has no idea why it is happening.. what could be the
    > reason?
    >
    > Thanks,
    > Peter


    By default the account that ASP.Net uses has no rights to create
    directories or write to the filesystem. Apparently the access rights
    that did grant you "create directory" rights have changed.
    Did your provider change the default ASPNET user?
    Did your provider move your site to a different physical directory?
    What happened two weeks ago?

    Hans Kesting
     
    Hans Kesting, Mar 8, 2006
    #3
  4. Stimp

    Stimp Guest

    On Wed, 8 Mar 2006 Hans Kesting <> wrote:
    >> When a user registers with my site, I create a separate folder for them
    >> (for uploading photos, etc).
    >>
    >> The code for this has been working fine for 1 year, but over the past 2
    >> weeks it has been falling down on the 'CreateDirectory' function.
    >>
    >> The error I'm getting is:
    >>
    >> "Could not find a part of the path "E:\"."
    >>
    >>
    >> Here's the code where the site falls down:
    >>
    >> Directory.CreateDirectory(Server.MapPath("members\" & sUserName.ToLower))
    >>
    >>
    >> My host provider has no idea why it is happening.. what could be the
    >> reason?
    >>
    >> Thanks,
    >> Peter

    >
    > By default the account that ASP.Net uses has no rights to create
    > directories or write to the filesystem. Apparently the access rights
    > that did grant you "create directory" rights have changed.
    > Did your provider change the default ASPNET user?
    > Did your provider move your site to a different physical directory?
    > What happened two weeks ago?


    I just rang my hosting provider there and they told me that they have
    upgraded the security on their servers for ASP.NET accounts so that I
    can no longer create a folder from the server root directory (i.e. E:\).

    Instead, he suggests, I'll need to create a directory from the
    Application root.

    This means that:
    Directory.CreateDirectory(Server.MapPath("members\blah"))

    is not allowed with the Server.MapPath part...

    but I'll need to use something else instead like:

    Directory.CreateDirectory("members\" & sDirName)

    But of course, this doesn't work.

    Any suggestions on an alternative CreateDirectory structure?

    Thanks,
    Peter
    --

    fiddlewidawiddum
     
    Stimp, Mar 8, 2006
    #4
  5. Stimp

    Stimp Guest

    Stimp, Mar 8, 2006
    #5
    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. Joel Finkel
    Replies:
    0
    Views:
    498
    Joel Finkel
    Sep 12, 2003
  2. Jeffry van de Vuurst
    Replies:
    2
    Views:
    539
    Jeffry van de Vuurst
    Jul 30, 2003
  3. =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=

    Multiple bin-directories with virtual directories?

    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=, Nov 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    832
    =?Utf-8?B?TGFzc2UgTmlsc3Nvbg==?=
    Nov 9, 2004
  4. Paul F
    Replies:
    4
    Views:
    642
    Mark Fitzpatrick
    Jun 25, 2008
  5. Adam Petrie
    Replies:
    8
    Views:
    319
    Adam Petrie
    Oct 11, 2004
Loading...

Share This Page