ASP Forum
ASP.NET Create a folder using C#
stimpy | Posted 6:26am 3. April 2007 Server Time |

I'm working on a file upload project. What I want to do is give the user the ability to enter a directory name, check to see if it already exists and if not create the folder and upload the files there.

What namespaces should I be using? Am I correct in presuming the directory that will house these "user-created directories" will need to have write permissions assigned to it?

Also, has anyone got an example I can start from? I googled it but all the folder creation stuff I found was for classic ASP and not asp.net.
DJGray | Posted 7:20am 4. April 2007 Server Time |

System.IO.Directory.CreateDirectory(@"c:\NewFolder");
System.IO.Directory.CreateDirectory(@"c:\NewFolder\NewSubFolder");
stimpy | Posted 9:23am 5. April 2007 Server Time |

Cool! Thanks!
fzas | Posted 7:02am 29. January 2008 Server Time |

Where do you place this code?


Reply to Post ASP.NET Create a folder using C#



Back to Forum Page