如何使用asp 转化data:image/png;base64转换为png 并下载
使用下面代码即可
<%
使用下面代码即可
<%
Subfolder=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now()) ''生成当天的子文件夹的名称
picture="这里是图片地址"
picture=replace(picture,"data:image/png;base64,","")
path=Subfolder&".jpg"
xmlstr="<data>"&picture&"</data>"
Dim xml : Set xml=Server.CreateObject("MSXML2.DOMDocument")
Dim stm : Set stm=Server.CreateObject("ADODB.Stream")
xml.resolveExternals=False
xml.loadxml(xmlstr)
xml.documentElement.setAttribute "xmlns:dt","urn:schemas-microsoft-com:datatypes"
xml.documentElement.dataType = "bin.base64"
stm.Type=1 'adTypeBinary
stm.Open
stm.Write xml.documentElement.nodeTypedValue
stm.SaveToFile Server.MapPath(path)
stm.Close
Set xml=Nothing
Set stm=Nothing
response.Write("http://codeo.cn/"&path)
%>