public async Task <ActionResult> UploadImage(int id, string lang) { if (HttpContext.Request.Files.Count > 0) { var result = await _pages.AddImageToPage(new AddImageInput() { Image = HttpContext.Request.Files[0], Lang = lang, PageId = id }); return(Json(result, JsonRequestBehavior.AllowGet)); } throw new UserFriendlyException(L("AddImage")); }