我从sql中取出的图片为什么不能显示?另向大家拜个晚年
我的代码:显示图片的语句
<img id="picture" src="showimage.asp?id=<%=fujianid%>">
showimage.asp
Dim conn1
Set conn1=Server.CreateObject("adodb.connection")
conn1.Open "Driver={SQL Server};Server=kcy-shinan;Database=shinan;" & _
"UID=sa;PWD=sa"
sub endConnection()
conn1.close
set conn1=nothing
end sub
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
Response.ContentType = "image/*"
dim rstCache
set rstCache = conn1.Execute("select fj from fj where ID="&Request.QueryString("id"))
Dim img_size
img_size = rstCache(0).ActualSize
Response.BinaryWrite rstCache(0).getChunk(img_size)
rstCache.close
set rstCache=nothing
测试后可输出 img_size 大小为 50, 可是图片不能显示;另图片在sql中的格式为 image
希望各位给指点一下,呵呵