图片上传问题纯asp上传
我存入数据库里的数据是二进制数据而不是路径 请问怎么解决 还有我图片显示不出来 还有我要存在数据库的是相对路径请问怎么实现首页
<form name="mainForm" enctype="multipart/form-data" action="process.asp" method=post>
<label>
<input type="file" name="file1" />
</label>
<br />
<input type=submit name=ok value="OK">
</form>
process.asp
<!--#include file="conn1.asp"-->
<%
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 [imgage] where id is null",conn,3,2
rs.addnew
rs("img").appendchunk(mydata)
rs.update
rs.close
set rs=nothing
set conn=nothing
%>
show.asp
<!--#include file="conn1.asp"-->
<%
Set rs=server.CreateObject("ADODB.Recordset")
sql="select img from imgage where id=4"
rs.open sql,conn,3,2
Response.ContentType="image/*"
Response.BinaryWrite rs("img").getChunk(7500000)
rs.close
set rs=nothing
set conn=nothing
%>
数据库
id img