Can any one tell me how to decode a base64 encoded image in classic ASP? The image is encoded by Java org.apache base64 class. The Java uses RFC 2045 for base64 decoding.
<%
Set objXML = Server.CreateObject("MSXml2.DOMDocument")
Set objDocElem = objXML.createElement("Base64Data")
objDocElem.DataType = "bin.base64"
objDocElem.text = "/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAUD" 'encodedString
'Save to disk
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.Write objDocElem.NodeTypedValue
objStream.SaveToFile "abc.jpg", 2
set objStream = Nothing
'Or send to browser
Response.ContentType = "image/jpeg"
Response.AddHeader "Content-Disposition", "attachment; filename=abc.jpg";
Response.BinaryWrite objDocElem.NodeTypedValue
Set objXML = Nothing
Set objDocElem = Nothing
%>