<html>
<body>
<form enctype="multipart/form-data" action="addpic.asp" method=post onsubmit="return mysubmit(this)">
<table border="0" width="50%" cellspacing="0" cellpadding="0">
<tr><td><p align="center">
<input name="ll" type="text" id="ll">
</p>
<p align="center"> </p>
<p align="center">图片地址:
<input type="file" name="fj" size="20">
</p></td></tr>
<tr><td><p align="center"><input type="submit" value="上传" name="B3"></p>
</table>
<p> </p>
</form>
</body>
</html>
<!--#include file="conn.asp"-->
<%
dim formsize,formdata,bncrlf,divider,datastart,dataend,mydata
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")'将数据存入数据库
sql="select * from wtgl2"
rs.Open sql,conn,3,2
rs.addnew
rs("fj").appendchunk mydata
rs("ll")=ll
rs.update
set rs=nothing
set conn=nothing
%>
数据库是ORACLE的,表名:wtgl2
字段:xh(自动生成的数值),fj(blob),ll(字符型)
[此贴子已经被作者于2006-4-19 20:18:41编辑过]