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

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

    Remove the unnecessary string through Regex

    Regex regex=new Regex(@"^[\w/\:.-]+;base64,");
    base64File=regex.Replace(base64File,string.Empty);
    

提交回复
热议问题