예제 #1
0
        public ActionResult SaveImage(string image)
        {
            var profilePicUrl = ImageHelper.SaveBaseEnCodedToImage(image, Server.MapPath("~/Images/Upload"));
            var model         = new UserImageViewModel
            {
                UserId   = User.Identity.GetUserId(),
                ImageUrl = profilePicUrl
            };

            _userServiceAgent.SaveProfileImage(model);

            SessionHelper.Get <UserProfileViewModel>(User.Identity.GetUserId()).ImageUrl = profilePicUrl;
            SessionHelper.UserImage = profilePicUrl;
            return(Json(new { success = true, imageUrl = profilePicUrl }, JsonRequestBehavior.AllowGet));
        }