Results 1 to 5 of 5

Thread: Directory.CreateDirectory

  1. #1

    Thread Starter
    Hyperactive Member spoiledkid's Avatar
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    437

    Directory.CreateDirectory

    I am using this function to try and create a directory in my Web project folder .. using ASP.NET ..

    System.IO.Directory.CreateDirectory(server.mappath("\test")) ..

    No matter what path I give it always says "Access Denied to the path .." blah blah blah ..

    What am I missing ??

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Re: Directory.CreateDirectory

    Use a PHYSICAL Path instead of a Virtual Path.

    Use:

    Code:
    system.IO.Directory.CreateDirectory(Request.PhysicalApplicationPath & "\test")

  3. #3
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Directory.CreateDirectory

    The account that ASP.net is running under doesn't have "Create folders / append data" privileges to the parent folder (e.g. c:\ASP.Net, where you wish to create c:\ASP.Net\test). I suggest you investigate the minimum requirements (e.g. "Read" and "Write") and apply them to the ASP.net user (by default MACHINENAME/ASPNET

  4. #4

    Thread Starter
    Hyperactive Member spoiledkid's Avatar
    Join Date
    Oct 2002
    Location
    Canada
    Posts
    437

    Re: Directory.CreateDirectory

    Quote Originally Posted by axion_sa
    The account that ASP.net is running under doesn't have "Create folders / append data" privileges to the parent folder (e.g. c:\ASP.Net, where you wish to create c:\ASP.Net\test). I suggest you investigate the minimum requirements (e.g. "Read" and "Write") and apply them to the ASP.net user (by default MACHINENAME/ASPNET
    How do you apply those permissions to ASPNET user ??

  5. #5
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: Directory.CreateDirectory

    Via Windows Explorer - stock standard NTFS permissions

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width