public ActionResult AddHomeImage(HttpPostedFileWrapper file) { string fileName = DateTime.Now.ToString("yyyyMMddhhssmm"); var vpath = Path.Combine("/img/", fileName + Path.GetExtension(file.FileName)); string path = Server.MapPath("~" + vpath); file.SaveAs(path); JObject obj = new JObject(); obj["path"] = vpath; string str = api.AddHomeImage(obj); return(RedirectToAction("HomeImages")); }