public ActionResult EditSubmit(EditJob data, int?jobId) { if (!string.IsNullOrWhiteSpace(data.Photo)) { var originalDirectory = new DirectoryInfo(string.Format("{0}MediaUpload\\", Server.MapPath(@"\"))); var pathString = Path.Combine(originalDirectory.ToString(), "JobPhoto"); var ext = Path.GetExtension(data.Photo); var photoName = "temp" + GetOperation().UserId + ext; data.Photo = string.Format("{0}\\{1}", pathString, photoName); } var result = JobLogic.Edit(GetOperation().UserId, data, jobId); return(Json(result)); }