Base64Decode

CAS XML Script Library

The Base64Decode function converts a BSTR in base64 format to it's original format and returns the output data as a BSTR.  The output BSTR may contain binary characters.

This function is provided in script for applications that cannot use ActiveX controls.  If the FaxBackX ActiveX control is installed, Base64Decode will automatically use the faster FaxBackX method, base64_decode, to perform the conversion.

BSTR Base64Decode(
  BSTR InputData // Base64 data to decode
)


Parameters:
InputData Base64 data to decode

Return Value:
Original form of BSTR, which may contain binary characters.

Example:
function GetMsgFile( MessageHandle, MessageFileToGet )
  {
  var Tl = xmlTlNew();
  xmlTlAddTag(Tl,"GET_FILE_FUNCTION",null);
  xmlTlAddTag(Tl,"REGISTERED_NAME","User1");
  xmlTlAddTag(Tl,"REGISTERED_PASSWORD","");
  xmlTlAddTag(Tl,"MESSAGE_HANDLE",MessageHandle);
  xmlTlAddTag(Tl,"CURRENT_FILESPEC",MessageFileToGet);

  var responseXML = xmlTlSend(Tl,
                              "\\\\FAX\\NETSAT",
                              "NETSAT",
                              2,
                              "http://netsat/casxml.asp");

  if (xmlGetTag(responseXML,"STATUS_NUM") == 0)
    {
    return(Base64Decode(xmlGetTag(responseXML,"CONTENT_DATA")));
    }
    
  return("");
  }
See Also:
xmlTlNew, xmlTlAddTag, xmlTlSend, Base64Encode