Johan Boog
asked on
How can I retrieve an image(png/gif/...) stored in SQL (Byte[] Array) with VBS and convert to BASE64
I managed to get the data in a Array:
Fielddata = SQLdata.Fields(2).Value
wscript.popup Ubound(Fielddata) 'result in a big number
I tried this :
Dim dom: Set dom = CreateObject("Microsoft.XM LDOM")
Dim elem: Set elem = dom.createElement("tmp")
elem.dataType = "bin.base64"
elem.nodeTypedValue = join(Fielddata)
convertImageToBase64 = "data:image/png;base64," &Â Replace(elem.text, vbLf, "")
But the join resulting in a Typ Mismatch : 'join'
How can I convert the data from SQL to a BASE64 string?
Thanx,
Johan
Fielddata = SQLdata.Fields(2).Value
wscript.popup Ubound(Fielddata) 'result in a big number
I tried this :
Dim dom: Set dom = CreateObject("Microsoft.XM
Dim elem: Set elem = dom.createElement("tmp")
elem.dataType = "bin.base64"
elem.nodeTypedValue = join(Fielddata)
convertImageToBase64 = "data:image/png;base64," &Â Replace(elem.text, vbLf, "")
But the join resulting in a Typ Mismatch : 'join'
How can I convert the data from SQL to a BASE64 string?
Thanx,
Johan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
ASKER