Decoding base64 Image Data

Results 1 to 3 of 3

Thread: Decoding base64 Image Data

  1. #1
    Join Date
    Dec 1969

    Default Decoding base64 Image Data

    I&#039;m recieving Image Data in an XML Response. I need to decode the data and save it to a .png file. All of the examples I have found use <BR><BR>objXML.selectSingleNode("nodeName").nodeTy pedValue <BR><BR><BR>I can not get it to work for me.<BR><BR>The examples I have been looking at are :<BR><BR><BR><BR>HERE is my code<BR>Sub TranslateXML(xslDocPath,xmlDoc)<BR> Dim objXMLDoc<BR> Dim objStream &#039;this is used to decode the barcode imagedata<BR> <BR> Set objStream = Server.CreateObject("ADODB.Stream")<BR> objStream.Type = 1 &#039; 1=adTypeBinary <BR> objStream.Open <BR> <BR> Set ObjXMLDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")<BR>< BR><BR> &#039;load XML and XSL Documents<BR> ObjXMLDoc.loadXML(xmlDoc)<BR><BR> &#039;The nodeTypedValue automagically converts Base64 data to binary data<BR> &#039;Write that binary data to the stream<BR><BR> &#039;This is where it all blows up!<BR> objStream.Write objXMLDoc.selectSingleNode("res/Barcodes/AWBBarCode").nodeTypedValue <BR><BR> <BR> &#039;Get the FileName attribute&#039;s value<BR> strFileName = "barcode.png" <BR> &#039;Save the binary stream to the file<BR> objStream.SaveToFile "D:RobR\" & strFileName,2 <BR>&#039; 2=adSaveCreateOverWrite <BR> <BR> objStream.Close()<BR><BR> Set objStream = Nothing

  2. #2
    Join Date
    Dec 1969

    Default * Crosspost. Advanced.

    Please see FAQ #110 on

  3. #3
    Join Date
    Dec 1969

    Default RE: Decoding base64 Image Data

    Waseer.: I am in a similar situation.<BR>Can U Pls Call email me your contact<BR>Thanks <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts