1

I'm getting the error mentioned below when i try to decode a base64 string to file and save it locally. I've done some research online and couldn't find the solution. Thanks in advance.

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

    Const adTypeBinary = 1
    Dim str 
    str = strBase64Content 'base64 string here

    Dim objXML 
    Dim objNode

    Set objXML = CreateObject("Msxml2.DOMDocument.6.0")
    Set objNode = objXML.createElement("b64")
    objNode.DataType = "bin.base64"
    objNode.Text = strBase64Content
    decodeBase64 = objNode.nodeTypedValue

    Set objNode = Nothing
    Set objXML = Nothing

    set stream =  server.CreateObject("ADODB.Stream")
    stream.Open
    stream.Type = adTypeBinary
    stream.Write decodeBase64
    stream.SaveToFile "C:\"
    stream.Close
Gustav
  • 53,498
  • 7
  • 29
  • 55
HelloWorld1014
  • 173
  • 2
  • 12

0 Answers0