Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send image through XML using C#

Tags:

c#

I have a image that I need to embed in XML and then retrieve the image using C#. How can I do this?

like image 942
Vinay V Avatar asked Dec 17 '25 18:12

Vinay V


1 Answers

Convert it to a byte[] and convert this to a Base64 datablock (using Convert.ToBase64String()), which you put into the xml. On the other side, you simply have to decode it with Convert.FromBase64String() and deal with the resulting byte[] the way you like.

like image 126
Femaref Avatar answered Dec 20 '25 07:12

Femaref



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!