为什么图片可以上传,但显示不出来我穷只能悬赏分小.upload.htm
为什么图片可以上传,但显示不出来
我穷只能悬赏分小.
upload.htm
process.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 connGraph=server.CreateObject("ADODB.connection")
connGraph.Open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.MapPath("images.mdb")
set rec=server.createobject("ADODB.recordset")
rec.open "select * from pic",connGraph,1,3
rec.addnew
rec("img").appendchunk mydata
rec.update
rec.close
set rec=nothing
set connGraph=nothing
%>
showimg.asp
set connGraph=server.CreateObject("ADODB.connection")
connGraph.Open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.MapPath("images.mdb")
set rec=server.createobject("ADODB.recordset")
rec.open "select img from [biao] where id="&trim(request("id")),connGraph,1,1
if not rs.eof then
Response.ContentType = "image/gif"and"image/ole"
Response.BinaryWrite rs("picture").getChunk(7500000)
rs.close
set rs=nothing
set conn=nothing
else
rs.close
set rs=nothing
set conn=nothing
%>
展开