Subject Re: Show a Jpg stored as Binary blob in a firebird table with PHP
Author Didier Gasser-Morlay
--- In firebird-php@yahoogroups.com, "prom_prometheus"
<prometheus@a...> wrote:
> Hello,
> can someone help me?

Can try ;) but this is more a PHP question than anything else.

> I try to make a webpage (PHP4, Firebird 1.5 b3, Apace WEbserver)
> and have the following problem:
> show pictures that was stored in a table as binary blob
> ...,
> GID integer not null,
> GRUND_FOTO BLOB SUB_TYPE 0 SEGMENT SIZE 80,
> ...
> echo row->grund_foto didn't work, smile ...

1°) have a look at http://php.weblogs.com/adodb -> REALLY good & fast
db wrapper. John Lim is a clever guy ! there is some support for blobs.

2°) the answer mainly depends on your circumstances : hosting,
standard or secure (HTTPS), your level of access to the host, what you
really intend to do (ie show the image as such, on it's own, or as
part of a more complex layout (e.g. say it's a shot of a product on a
product page)

In the long run, I believe that the simplest/more reliable would be to
1- write the blob to disk as a file (xxx.jpg is it's a jpeg) and
2- send a HREF link to it as part of an IMG tag. this way your turn
around a really difficult long standing IE bug when you try to PUSH
some data to your user's browser.


3°) now, that being said ... you should also consider whether or not
is is worthwhile having the images INSIDE the db, and not simply have
a link to those, stored on disk. Again this depends on many factors
but remember that blobs tend to ... bloat a db pretty swiftly, making
a backup & restore process that much more difficult (look at the
current thread on gbak on firebird-support)


> thanks
You'll thank me if I made sense at all! :)
Didier

> -Gerhard