怎么我显示的图片是*呢?
从数据库显示图片的问题
我可以把图片写入数据库中的image字段,但是怎么显示出来呢?用<img src=show.asp?id=1> 不行,显示的是一个* ,但是用flashget 可以把图片下载下来,但是名字是show.asp。
贴出我的代码,请看
a.html
_____________________________________________
<img src="show.asp?id=1">
show.asp
------------------------------------------------
<%
Response.Expires = 0
Response.buffer=True
Response.ContentType="image/*"
dim connGraph
set connGraph=server.CreateObject("ADODB.connection")
connGraph.ConnectionString="driver={sql server};server=localhost;database=northwind;uid=stpangpang;pwd=stpangpang"
connGraph.Open
dim rec
set rec=server.createobject("ADODB.recordset")
strsql="select img from images where id ="&request.QueryString("id")
rec.open strsql,connGraph,1,1
Response.BinaryWrite rec("img").GetChunk (7500000)
rec.close
set rec=nothing
set connGraph=nothing
%>
我郁闷了,希望高人能解决