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
arrays c # url image base64


source to share


No one has answered this question yet

Check out similar questions:

6155
What is the difference between string and string in C #?
4622
What is the maximum URL length in different browsers?
4193
What is the difference between URI, URL and URN?
3419
How do I change the URI (URL) for a remote Git repository?
2853
Get the current url using JavaScript?
2701
How do I get the values ​​of a query string in JavaScript?
2366
Encode url in JavaScript?
2170
How can I change the url without reloading the page?
1832
Lazy loading images in ListView
1690
Get current url using jQuery?



All Articles
Loading...
X
Show
Funny
Dev
Pics