[原创]把数据库中的二进制图片保存在文件夹里
<%
Dim conn,sql
Set conn=Server.CreateObject("ADODB.Connection")
sql="Dbq="&Server.Mappath("Database/db_Delphidictionary.mdb")&";Driver={Microsoft Access Driver (*.mdb)}"
conn.Open sql
Set Rs = Server.CreateObject("Adodb.RecordSet")
Sql1 = "select * from tb_img"
Rs.Open Sql1,Conn,1,3
Set MyStream=Server.CreateObject("Adodb.Stream")
MyStream.Type = 1
MyStream.Open
MyStream.Write rs("img").GetChunk(rs("img").ActualSize) '将数据写入Stream对象中
MyStream.SaveToFile server.MapPath("Upload")&"\" & Rs("Name") '保存文件
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
%>
Upload文件夹 Name 文件名要加扩展名