In my application,I want to create a first folder where user can upload all videos.
next to this folder there should be new button add when click on that add new folder should generate and user can give any name to it.
and inside that he can save some text docs or images or anything.
How to create such a folders?
Loading
Munesh SharmaPosted Apr 9, 2014, 2:57 AM
First of all be sure that you are importing/using (depending on language) the System.IO namespace for this to work. But what you can do is something like this
string pathToCreate = "~/UserFolders/" + TextBox1.Text;
if(Directory.Exists(Server.MapPath(pathToCreate))
{
//In here, start looping and modify the path to create to add a number
//until you get the value needed
}
//Now you know it is ok, create it
Directory.CreateDirectory(Server.MapPath(pathToCreate));