3
I’m trying to decode an image, the string that comes as a parameter in the Image attribute of the post object looks like this: "data:image/png;Base64," and a lot of letters, numbers, and symbols on the right,
I want to decode and get the original image to save in a directory, is it possible? I tried to use Convert.Frombase64string however I was unsuccessful, someone has any idea what it is?
public void NewPost(Post post)
{
post.Image = post.Image.Replace("data:image/png;base64,", "");
byte[] byteObject = Convert.FromBase64String(post.Image);
.
.
.
.
}
I don’t get it: in theory when you encode an image for Base64, it’s its entire content, not the URL. That’s right?
– Leonel Sanches da Silva
Gypsy, yes, you are correct, it was my mistake to put the attribute as imageurl, I will edit, vlw
– Ivan Ricardo Lopes
@Ukyron has how to make available the value of this Base64?
– user6026