用纯ASP代码实现图片上传并存入数据库中如何写呀
以下是网上找的,可实现不了,不知它错在哪?谁有现成的发来呀.<%
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13)&chrB(10)
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf&bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
set conn=server.CreateObject("adodb.connection")
dsn="driver={microsoft access driver (*.mdb)};"
dsn=dsn&"dbq="&server.MapPath("ubload.mdb")
conn.open dsn
set rs=server.createobject("ADODB.recordset")
sql="SELECT * FROM imagegook"
rs.open sql,conn,1,3
rs.addnew
rs("img").appendchunk mydata
rs.update
rs.close
set rs=nothing
set conn=nothing
%>