|
下面是图片上传的一些代码,能帮我说详细的注释一下。这几句我看不懂:
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1
datastart=instrb(formdata,bncrlf&bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
option explicit
dim conn.dbpath
dim rs.sql
dim formsize,formdata,bncrlf,divider,datastart,mydata,dataend
set conn=server.createobject("adodb.connection")
dbpath=server.mappath("db.mdb")
conn.open "driver={microsoft access driver (*.mdb)}"dbq="&dbpath
set rs=server.createobject("adodb.recordset")
sql="select*from photo"
rs.open sql,conn,3,2
formsize=request.totalbytes
formdata=requext.binaryread(formsize)
bncrlf=chrB(13)&chr(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)
rs.addnew
rs("img').appendchunk=mydata
rs.update
rs.close
set rs=nothing
set conn=nothing
response.redirect
%> |
|