The input is not a valid Base-64 string as it contains a non-base64 character

后端 未结 11 1720
难免孤独
难免孤独 2020-11-27 14:37

I have a REST service that reads a file and sends it to another console application after converting it to Byte array and then to Base64 string. This part works, but when th

11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 15:28

    We can remove unnecessary string input in front of the value.

    string convert = hdnImage.Replace("data:image/png;base64,", String.Empty);
    
    byte[] image64 = Convert.FromBase64String(convert);
    

提交回复
热议问题