public ActionResult ProfileChanges(ProfileModel model, HttpPostedFileBase image)
{
if (ModelState.IsValid)
{
if (image != null)
{
model.ImageMimeType = image.ContentType;
model.ImageData = new byte[image.ContentLength];
image.InputStream.Read(model.ImageData, 0, image.ContentLength);
}
var userId = this.userProcessor.GetUserByName(User.Identity.Name).Id;
this.userProcessor.UpdateUsersPhoto(userId, model.ImageData, model.ImageMimeType);
}
return this.RedirectToAction("Profile");
}