如何把数据库里的图片都显示出来?Response.BinaryWrite rst("img").getChunk(7500000)这个好像不行

soyan 2005-03-19 04:49:05
如何把数据库里的图片都显示出来?Response.BinaryWrite rst("img").getChunk(7500000)这个好像不行
...全文
265 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ming709 2005-06-15
  • 打赏
  • 举报
回复
up
纪俊 2005-03-19
  • 打赏
  • 举报
回复
soyan (埋伏十年) 我算认识你了呵呵~~
comegem 2005-03-19
  • 打赏
  • 举报
回复
zp.asp
<%
Response.Buffer =true
Response.ContentType="gif/image"
dim sql_picture
dim picture_rs
sql_picture="select zp from zp_tab where id = '"+request("id")+"'"
set picture_rs=conn.execute(sql_picture)
Response.BinaryWrite picture_rs.fields("zp").value
%>

zplist.asp

<title>照片</title>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll=no>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from zp_tab order by id"
rs.Open sql, conn, 3, 3
if not rs.eof then
rs.move currec
do while not rs.eof
Response.Write "<img border=0 width=90 height=120 align=center src=zp.asp?id="&id&"&type=1> "
rs.movenext
loop
end if
%>
soyan 2005-03-19
  • 打赏
  • 举报
回复
我是要连续显出来的
纪俊 2005-03-19
  • 打赏
  • 举报
回复
'''''''''show.asp'''''''''
<img src=showimg.asp?propertynum=111>

'''''''''''showimg.asp''''''''''''''
<!--#include file="../../inc/conn2.asp"-->
<%
propertynum=Request("propertynum")
set rs=server.CreateObject("adodb.recordset")
sql="SELECT * FROM propertytb where propertynum="&propertynum
rs.Open sql,conn,1,1
Response.ContentType="image/*"
Response.BinaryWrite rs("propertypic").getchunk(7500000)
%>

这时才能在show.asp来显示出图片
  • 打赏
  • 举报
回复
response.clear
Response.ContentType = "image/*"
Hotlion 2005-03-19
  • 打赏
  • 举报
回复
注意在输出到浏览器之前一定要指定Response.ContentType = "image/*",以便正常显示图片。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧