dim conn,str
set conn=server.CreateObject("ADODB.connection")
str="driver={microsoft access driver (*.mdb)};dbq=e:\aspstation\database\db3.mdb"
conn.Open str
set rs=server.createobject("ADODB.recordset")
rs.Open "SELECT * FROM images where id is null",conn,1,3
rs.addnew
rs("img").appendchunk mydata
rs.update
rs.close
set rs=nothing
set conn=nothing
%>
</body>
showimg.asp:
<body>
<%
dim conn,str
set conn=server.CreateObject("ADODB.connection")
str="driver={microsoft access driver (*.mdb)};dbq=e:\aspstation\database\db3.mdb"
conn.Open str
dim rs,sql
set rs=server.createobject("ADODB.recordset")
sql="select img from images where id="&trim(request("id"))
rs.open sql,conn,1,1
Response.ContentType = "image/*"
Response.BinaryWrite rs("img").getChunk(7500000)
rs.close
set rs=nothing
set conn=nothing
%>
</body>
上面的代码有错误么?
如何显示我上传的图片?运行showimg.asp可以么?作者: 汽车小改装 时间: 2010-2-26 18:05
偶学习的对像‖→为你伤心为你哭