Posted on: 9/11/2014 9:51:52 AM | Views : 425

Ok I'm working with this upload file action result, if the file with unique Name already exists it should override the existing file
here is my code .. I tried a couple of things given online but nothing works ... all other things that I tried are also in comments. Ive used all
File.Copy() File.Move() Stuff but nothing works it just saves an other file with a little exception
public ActionResult UploadWorkSheetFiles(IEnumerable files, long id = 0, string documentType="") { id = Convert.ToInt64(Request["id"]); foreach (HttpPostedFileBase file in files) { //var uniqueName = Guid.NewGuid().ToString(); // Some browsers send file names with full path. var uniqueName = id + "-" + documentType + "-WorkSheet"; // We are only interested i ...

Go to the complete details ...