How to update Profile picture using Asp.net C# Web Api + ionic 4

  • Thread starter Thread starter ANKURSINH
  • Start date Start date
A

ANKURSINH

Guest
i'm using .net web api to update data in ionic 4.

so i'm using this code for updating data and i don't know how to write code for updating profile image for web api i tried different logics and codes but it didn't worked.

so someone provide me the same.

Below code is for updating profile data without image, so what should i write for updating profile images.?

//---------------------------------------------------------------------------------------------------------------------

[Route("api/User/UpdateData")]
[HttpPost]
[AllowAnonymous]

public IdentityResult UpdateData(AccountModel model)
{
var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
var user = manager.FindByEmail(model.Email);
if (user != null)
{
user.FirstName = model.FirstName;
user.LastName = model.LastName;
user.MobileNo = model.MobileNo;
}
else {
}
IdentityResult result = manager.Update(user);
return result;
}

//---------------------------------------------------------------------------------------------------------------------

Continue reading...
 
Back
Top