如何从oracle库中取出图片?

小婷_wuni 2001-11-28 10:32:30
图片已经以blob型存在数据库中,但是如何取出显示呢
...全文
165 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
genbin 2001-12-27
  • 打赏
  • 举报
回复
你很不幸,找不到,和你讲一下原理吧,
在上传文件时,ie会对文件的头尾加一些字节,在存入数据中的时候,要把这些字节去掉,
具体算法我忘了,文件的数据结构我也忘了,呵呵。找找看吧,会有的
genbin 2001-12-27
  • 打赏
  • 举报
回复
呵呵,本人有做过。你等等,我找找看,好久以前做的了
小婷_wuni 2001-12-05
  • 打赏
  • 举报
回复
怎么看呢,你在不在QQ上啊,如果做出来的话大家都有分,我可以再加点分的
fengerfeifei 2001-12-03
  • 打赏
  • 举报
回复
你看看$obj->load()
函数执行没有
如果没有你看看那个步骤跳出来了,是什么问题再仔细分析一下。
小婷_wuni 2001-11-30
  • 打赏
  • 举报
回复
还是不行啊,输出是那个以红叉的那种
如果从路径中取呢,会不会方便点呢。
小婷_wuni 2001-11-29
  • 打赏
  • 举报
回复
谢谢,我来试试看,还有没有其它方法?
karma 2001-11-29
  • 打赏
  • 举报
回复
from PHP.FAQTS:
http://www.faqts.com/knowledge_base/view.phtml/aid/666/fid/876


How do I get an image in a mySQL/Oracle (or other) blob fields to display on a regular html page?
Jan 25th, 2000 15:33

Matt Gregory, Onno Benschop





//The problem is that binary data cannot be inserted directly into
//an html file, so we must trick the browser into thinking it's
//retrieving an image on the webserver. To do this place an
//image tag on the page with the src set to a php script which returns
//nothing but a header and the image. The exampe below will return the
//image and fill in the image tag properly...

//example image tag
<image src="getimage.php3?ImgID=1">

//getimage.php3
if($ImgID != 0)
{
$Query = "Select Image from Images where ImgID = $ImgID";
mysql_connect($DBHOST, $DBUSER, $DBPASS);
mysql_select_db($DATABASE);
$resultset = mysql_query($Query);
if(mysql_affected_rows() > 0)
{
header("Content-type: image/jpeg");
print(mysql_result($resultset, 0, "Image"));
}


小婷_wuni 2001-11-29
  • 打赏
  • 举报
回复
真的没人会吗,我再加点分,各位大虾帮帮忙。急!!!!!!!!!!!
fengerfeifei 2001-11-29
  • 打赏
  • 举报
回复
我给你解决了要加分啊

2,596

社区成员

发帖
与我相关
我的任务
社区描述
Sybase相关技术讨论区
社区管理员
  • Sybase社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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