upload.asp
资源名称:08.zip [点击查看]
上传用户:ynjin1970
上传日期:2014-10-13
资源大小:6438k
文件大小:1k
源码类别:
中间件编程
开发平台:
Visual C++
- <!--#include file="adovbs.inc" -->
- <%
- '获得表单中上传文件的数据
- formsize=request.totalbytes
- formdata=request.binaryread(formsize)
- bncrlf=chrB(13) & chrB(10) & chrB(13) & chrB(10)
- bncrrt=chrB(13) & chrB(10) & chrB(45) & chrB(45) & chrB(45) & chrB(45)
- datastart=instrb(formdata,bncrlf)+4
- datalen=instrb(datastart+1,formdata,bncrrt)-datastart
- '获得文件数据
- mydata=midb(formdata,datastart,datalen)
- '打开数据库,往里面添加数据
- DbPath = SERVER.MapPath("oa.mdb")
- Set conn = Server.CreateObject("ADODB.Connection")
- conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
- Set rs = Server.CreateObject("ADODB.Recordset")
- sl="select * from upload"
- rs.Open "upload",conn,adOpenDynamic,adLockOptimistic
- rs.addnew
- rs("xm")=session("yzbxm")
- rs("f_topic")=session("yzbtopic")
- rs("f_name")=session("yzbwj")
- rs("f_date")=date
- rs("f_data").appendchunk mydata
- rs.update
- rs.close
- set rs=nothing
- conn.Close
- set conn=nothing
- response.redirect "getinfo.asp?msg="&session("yzbwj")&"上传成功!文件为"&datalen&"字节"
- response.end
- %>