5
Answers

Check whether Folder exists or not

Jagjit Saini

Jagjit Saini

12y
5.2k
1
Hi

  fn = Guid.NewGuid().ToString() + fuUploadFile.FileName.Substring(fuUploadFile.FileName.LastIndexOf("."));

   string filepath = Server.MapPath("~/Temp" + "\\" + fn);
   fuFile.PostedFile.SaveAs(filepath);

  I want it should check first whether folder (Temp) exists or not , if it does not exist it should create & if successfully created then it should save file. Secondly i want that folder name should be given in Web.Config from there it should pick name of folder & that it should check & create.


Thanx
Answers (5)