Jagjit Saini

Jagjit Saini

  • NA
  • 166
  • 0

Check whether Folder exists or not

Jan 25 2012 5:31 AM
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)