I'm trying to decode an image, the string that comes as a parameter in the Image attribute of the post object is like this: "data: image / png; base64," and a bunch of letters, numbers, and symbols on the right,
I want to decode and get the original image to save to a directory, is it possible? I tried to use Convert.FromBase64String but I did not succeed, does anyone have any idea what that is?
public void NewPost(Post post)
{
post.Image = post.Image.Replace("data:image/png;base64,", "");
byte[] byteObject = Convert.FromBase64String(post.Image);
.
.
.
.
}