asp 无组件上传图片
怎么把数据库里的长二进制数转化位图片还原回来数据库
id 自动编号
imgage ole对象
upload.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<body>
<center>
<form name="mainForm" enctype="multipart/form-data" action="upimage.asp" method=post>
<input type=file name=mefile><br>
<input type=submit name=ok value="OK">
</form>
<IMG SRC="upshow.asp?id=10">
</center>
</body>
</html>
upimage.asp
<!--#include file="conn.asp"-->
<%
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13)&chrB(10)
'css.shtml' target='_blank' title = 'div视频教程'>
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 rec=server.createobject("ADODB.recordset")
rec.Open"SELECT * FROM [imgage] whereidisnull",conn,1,3
rec.addnew
rec("img").appendchunk(mydata)
rec.update
rec.close
set rec=nothing
set conn=nothing
%>
upshow.asp
<!--#include file="conn.asp"-->
<%
set rec=server.createobject("ADODB.recordset")
strsql="select img from imgage where id="&trim(request("id"))
rec.open strsql,conn,1,1
Response.ContentType="image/*"
Response.BinaryWrite rec("img").getChunk(7500000)
rec.close
set rec=nothing
set conn=nothing
%>
还有我如果把路径保存到数据库里,怎么让图片显示出来