public ActionResult Upload(HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { var fileName = Path.GetFileName(file.FileName); var folderPhysicalPath = Path.Combine(Configurations.UploadsFolder, Guid.NewGuid().ToString()); IOWrapper.CreateFolderIfNotExists(folderPhysicalPath); var path = Path.Combine(folderPhysicalPath, fileName); file.SaveAs(path); } return(View()); }
internal static void CreateFolderInUploads(Guid newGuid) { var path = Path.Combine(Configurations.UploadsFolder, newGuid.ToString()); IOWrapper.CreateFolderIfNotExists(path); }