>Set Talk off >Set Safety off > >* Create a temporary table in memory to hold our sample >Create cursor test (nID i, mImages m) >cImage = GetFile("JPG") >If Empty(cImage) >Return .F. >EndIf > >* Add a record >Append blank >Replace nID with Recno() >Append memo mImages from (cImage) > >* convert binary to Base64 to send it as text >Replace mImages with Strconv(mImages,13) > >Local oXA as XMLAdapter >oXA=CREATEOBJECT("XMLAdapter") >oXA.ADDTABLESCHEMA("test") >oXA.IsDiffgram=.F. >oXA.TOXML("c:\temp\test.xml","",.T.) >oXA.ReleaseXML(.F.) > >* close the temporary file >Use in Test > >* open XML with the associated program >DECLARE INTEGER ShellExecute ; >IN SHELL32.DLL ; >INTEGER nWinHandle,; >STRING cOperation,; >STRING cFileName,; >STRING cParameters,; >STRING cDirectory,; >INTEGER nShowWindow >ShellExecute(0, "Open", "test.xml", "", "c:\temp", 1) > >* receive XML >oXA.LoadXML("c:\temp\test.xml",.T.,.T.) >oXA.Tables.Item(1).ToCursor() >oXA.ReleaseXML(.F.) > >* decode image from Base64 and copy to disk >StrToFile(Strconv(mImages,14),"c:\temp\image.jpg") > >*show received image >ShellExecute(0, "Open", "image.jpg", "", "c:\temp", 1) > >* clean up >Release oXA > >* EOF > >>