Directory creation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sparky

    #1

    Directory creation

    I want to create a directory on my web server from within code. I've tried
    using Request.Physica lApplicationPat h() to get the location of the
    application, and appended my new directory on the end and used
    Directory.Creat eDirectory which fails with:

    System.IO.Direc toryNotFoundExc eption: Could not find a part of the path
    "d:\". at System.IO.__Err or.WinIOError(I nt32 errorCode, String str) at
    System.IO.Direc tory.InternalCr eateDirectory(S tring fullPath, String path) at
    System.IO.Direc tory.CreateDire ctory(String path) at ...

    BUT if I manually create the directory in an FTP program, and use
    Directory.Exist s, it manages to find the directory... the problem just
    appears to be creating.

    Any clues?

    Cheers

    Sparky


  • Steve C. Orr, MCSD

    #2
    Re: Directory creation

    It's probably a security issue. By default ASP.NET runs under the ASPNET
    user account. This account does not have a lot of permissions on your
    machine. Simply grant it full read, write & create permissions to the path
    you're specifying on your server.

    --
    I hope this helps,
    Steve C. Orr, MCSD



    "Sparky" <mark.smith@nos pam.farmade.com > wrote in message
    news:O0LIu0EUDH A.2228@tk2msftn gp13.phx.gbl...[color=blue]
    > I want to create a directory on my web server from within code. I've tried
    > using Request.Physica lApplicationPat h() to get the location of the
    > application, and appended my new directory on the end and used
    > Directory.Creat eDirectory which fails with:
    >
    > System.IO.Direc toryNotFoundExc eption: Could not find a part of the path
    > "d:\". at System.IO.__Err or.WinIOError(I nt32 errorCode, String str) at
    > System.IO.Direc tory.InternalCr eateDirectory(S tring fullPath, String path)[/color]
    at[color=blue]
    > System.IO.Direc tory.CreateDire ctory(String path) at ...
    >
    > BUT if I manually create the directory in an FTP program, and use
    > Directory.Exist s, it manages to find the directory... the problem just
    > appears to be creating.
    >
    > Any clues?
    >
    > Cheers
    >
    > Sparky
    >
    >[/color]


    Comment

    Working...