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 connGraph=server.CreateObject( "ADODB.connection ")
connGraph.ConnectionString= "driver={Microsoft Access Driver (*.mdb)};DBQ= " &
server.MapPath( "images.mdb ") & ";uid=;PWD=; "
connGraph.Open
set rec=server.createobject( "ADODB.recordset ")
rec.Open "SELECT * FROM [images] where id is null ",connGraph,1,3
rec.addnew
rec( "img ").appendchunk mydata
rec.update
rec.close
set rec=nothing
set connGraph=nothing
%>
下边我的知道,主要是第一段有些不懂??
------解决方案--------------------第一段?太多了不一一讲了,可能你不明白这几个.
response.buffer=true response的缓冲流为真
formsize=request.totalbytes 设置变量接受
formdata=request.binaryread(formsize) 设置变量接受
bncrlf=chrB(13) & chrB(10) 设置变量作用 回车换行
省略自己读吧