asp保存图片到库
2009-04-13 09:56:42 (5675)
1、提交页:
<form METHOD="POST" ACTION="*.asp" ENCTYPE="multipart/form-data">
<input TYPE="FILE" NAME="FI1" size="20">
<INPUT TYPE="Submit" onclick="return CheckLogin(this.form)" VALUE="提交图片">
再加javascript判断就可以了
2、存储页:
<%
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 rs=Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From image",conn,3,3
rs("image").appendchunk mydata
rs.update
rs.close
set rs=nothing
%>
了解更多请访问:
http://www.ndfweb.cn/news-284.html