关于图片显示问题!

pan5 2003-12-07 08:36:21
我数据库的photo表的字段photo_news设计image数据类型.
但是读出图片出来.
以下是我的asp代码
-----------2.asp
<!--#include file="objconnection.asp"-->
<% Response.Expires=0
Response.Buffer=true
Response.Clear
%>
<%
dim rs2,str2
set rs2=server.CreateObject("adodb.recordset")
str2="select * From photo_fun Where id_news='"&cstr(4)&"'"
rs2.Open str2,objconnection,1,1
if not rs2.EOF then
Response.ContentType ="image/*"
Response.BinaryWrite rs2("photo_news").GetChunk(7500000)
else
Response.Redirect "manage.asp"
rs2.Close
end if
%>
------- showok.asp
<img src="2.asp" width="80" height="100" border="0">


可是显示不了图片
...全文
86 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
pizixt 2004-03-06
  • 打赏
  • 举报
回复
脚本没什么问题,我也碰到过,一个站点显示很正常,相同的数据库相同的代码在另一个站点就怎么也不显示
dotnet东哥 2004-03-06
  • 打赏
  • 举报
回复
------- showok.asp
<img src="2.asp?id=xxx" width="80" height="100" border="0">
-----------2.asp
id=request.QueryString("id")
....
str2="select * From photo_fun Where id_news=" & id
...
stefli 2004-03-06
  • 打赏
  • 举报
回复
if not rs2.EOF then
if not isNull(rs2("photo_news")) then

...


end if
end if
struggle_wx 2004-03-06
  • 打赏
  • 举报
回复
帮你顶,我的也是这个问题

28,406

社区成员

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

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