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

后端 未结 11 1749
难免孤独
难免孤独 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:22

    And some times it started with double quotes, most of the times when you call API from dotNetCore 2 for getting file

    string string64 = string64.Replace(@"""", string.Empty);
    byte[] bytes = Convert.ToBase64String(string64);
    

提交回复
热议问题