public IActionResult Imagesave() { var file = Request.Form.Files["imageUploadForm"]; var fileName = Path.GetFileName(file.FileName); var pathImage = Path.Combine("images", fileName); var path = Path.Combine(hosting.WebRootPath, "images", fileName); file.CopyTo(new FileStream(path, FileMode.Create)); ApplicationUser u = user.GetUserAsync(HttpContext.User).Result; u.ImagePath = "/" + pathImage; service.EditPhotoAsync(u); return(PartialView("ImageDiv", user.GetUserAsync(HttpContext.User).Result)); }