Image in XML file
-
Hi, How can i "store" a image in a xml file? I am thinking in a byte[] like in sql server. <user> <f_name>John<f_name> <l_name>Black<l_name> <image>w3cvbjr7lerr4hh56ws2<image> <user> Any help welcome; link, code, whatever :wtf:
nelsonpaixao@yahoo.com.br trying to help & get help
-
Hi, How can i "store" a image in a xml file? I am thinking in a byte[] like in sql server. <user> <f_name>John<f_name> <l_name>Black<l_name> <image>w3cvbjr7lerr4hh56ws2<image> <user> Any help welcome; link, code, whatever :wtf:
nelsonpaixao@yahoo.com.br trying to help & get help
Since you can't stored just any old character you want in an XML file, you'll have to convert the image to a string that XML can hold. A thought off the top of my head says convert it to a base64 string and store that.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Hi, How can i "store" a image in a xml file? I am thinking in a byte[] like in sql server. <user> <f_name>John<f_name> <l_name>Black<l_name> <image>w3cvbjr7lerr4hh56ws2<image> <user> Any help welcome; link, code, whatever :wtf:
nelsonpaixao@yahoo.com.br trying to help & get help
As said above, you can use Base64: Make your image node of type xs:base64Binary[^]. Then, you can use System.Convert.FromBase64String[^] and System.Convert.ToBase64String[^] to read and write the binary value.