public ActionResult Save() { foreach (string file in Request.Files) { var FileDataContent = Request.Files[file]; if (FileDataContent != null && FileDataContent.ContentLength > 0) { // take the input stream, and save it to a temp folder using // the original file.part name posted var stream = FileDataContent.InputStream; var fileName = Path.GetFileName(FileDataContent.FileName); var UploadPath = Server.MapPath("~/App_Data/uploads"); Directory.CreateDirectory(UploadPath); string path = Path.Combine(UploadPath, fileName); try { if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } using (var fileStream = System.IO.File.Create(path)) { stream.CopyTo(fileStream); } // Once the file part is saved, see if we have enough to merge it Shared.Utils UT = new Shared.Utils(); UT.MergeFile(path); } catch (IOException ex) { // handle } } } return(View()); }