Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="frm"></param>
 /// <returns></returns>
 public ActionResult UploadProfileImage(FormCollection frm)
 {
     if (Request.Files.Count > 0)
     {
         try
         {
             string imageName = "";
             if (Request.Files.Count > 0)
             {
                 UserDomainLogic userdomainLogic = new UserDomainLogic();
                 imageName = userdomainLogic.UpdateProfileImage(Request);
             }
             return(Json(new { NewImage = imageName, Message = "File uploaded successfully", IsSuccess = true }));
         }
         catch (Exception ex)
         {
             return(Json(new { NewImage = "", Message = "Error occurred. Error details: " + ex.Message, IsSuccess = false }));
         }
     }
     else
     {
         return(Json(new { NewImage = "", Message = "No image selected.", IsSuccess = false }));
     }
 }