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 ??
Re: Directory.CreateDirectory
Use a PHYSICAL Path instead of a Virtual Path.
Use:
Code:
system.IO.Directory.CreateDirectory(Request.PhysicalApplicationPath & "\test")
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
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 ??
Re: Directory.CreateDirectory
Via Windows Explorer - stock standard NTFS permissions :)