XML and Binary Data
-
There is following problem: Some application (remote COM server) produces dynamically some JPGs. these files are to be shown in browser of the remote client. The current way the things work is the following: The COM server writes the file to HDD , and returns url to the file back to client (with other data , enclosed in xml file). Client than reads the url and displays the image from remote location. The question is : Is it possible to embed the JPG file _inside_ XML file , and than is the client able to display the JPG directly from XML ? (or previously having saved it onto local drive ?) If so, what software (COMponents) to use ? I heard somewhere that in order to put binary data into XML file , these data must be BASE64 coded. What component to use for codeing/decoding (is this component shipped with windows 2000/XP ?) Thanx for answer Michal Januszczyk
-
There is following problem: Some application (remote COM server) produces dynamically some JPGs. these files are to be shown in browser of the remote client. The current way the things work is the following: The COM server writes the file to HDD , and returns url to the file back to client (with other data , enclosed in xml file). Client than reads the url and displays the image from remote location. The question is : Is it possible to embed the JPG file _inside_ XML file , and than is the client able to display the JPG directly from XML ? (or previously having saved it onto local drive ?) If so, what software (COMponents) to use ? I heard somewhere that in order to put binary data into XML file , these data must be BASE64 coded. What component to use for codeing/decoding (is this component shipped with windows 2000/XP ?) Thanx for answer Michal Januszczyk
First, yes you can embedded any data inside an XML data node. I have encoded binary data just as a server would encoded it to send it to a browser and then decoded it on the other side. Take a look at this page as an explanation. http://www.nacs.uci.edu/indiv/ehood/MIME/1521/05\_Content-Transfer-Encoding.html#5.2 To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
-
There is following problem: Some application (remote COM server) produces dynamically some JPGs. these files are to be shown in browser of the remote client. The current way the things work is the following: The COM server writes the file to HDD , and returns url to the file back to client (with other data , enclosed in xml file). Client than reads the url and displays the image from remote location. The question is : Is it possible to embed the JPG file _inside_ XML file , and than is the client able to display the JPG directly from XML ? (or previously having saved it onto local drive ?) If so, what software (COMponents) to use ? I heard somewhere that in order to put binary data into XML file , these data must be BASE64 coded. What component to use for codeing/decoding (is this component shipped with windows 2000/XP ?) Thanx for answer Michal Januszczyk
In my current application, I am using SQLXML to access my data (including JPEG images) within SQL Server 2000. By using a mapping-schema to explicitly map the datatypes (from "image" to "base64binary"), the image is automatically encoded and decoded for me.