Image Base64 url ​​string to bytearray

I am using a rich editor in my application. In this editor, when I add an image, it returns the url base64 string. My problem is some images have base64 string too long so it can't go to byte array. How can I solve this problem. The code I wrote is below.

if (url.Contains("data:"))
            {
                int j = url.IndexOf(';');
                contentType = url.Substring(5, j-5);
                int i = url.IndexOf(',');
                url = url.Substring(i+1);


                data=Convert.FromBase64String(url);


            }

      

+3


source to share





All Articles