I have a base64 string that looks like this:
data:image/png;base64,iVBORw0KGgoA....
And I need to convert the string to an image as byte array so I do:
var b = Convert.FromBase64String(base64string);
But I get an exception:
System.FormatException: 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
What am I doing wrong?