Re: How to send bytea data straight to browser (as in pg_loreadall)?

From: Frank Joerdens <frank(at)joerdens(dot)de>
To: Frank Joerdens <frank(at)joerdens(dot)de>
Cc: pgsql-php(at)postgresql(dot)org, adam(at)archi-me-des(dot)de, linuxkurs(at)fas-art(dot)com
Subject: Re: How to send bytea data straight to browser (as in pg_loreadall)?
Date: 2002-04-01 19:09:37
Message-ID: 20020401210937.B13198@superfly.archi-me-des.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Mon, Apr 01, 2002 at 08:31:01PM +0200, Frank Joerdens wrote:
[ . . . ]
> understand some crucial point about how this works. How do you present
> an image to the browser without actually creating a file for it? The
> built in function pg_loreadall appears to do exactly that. I'd need to
> replicate that functionality for bytea.

An addition: Actually, just echoing the stripcslashed string to the
browser works just as with pg_loreadall if I put the script that does
the echoing into a teensy little html page as in

<img src="show_image.php">

where show_image.php is just a script that does

echo stripcslashes(pg_result($result, 2, image));

(after doing the sql stuff, that is).

Which means that I know how to do it without a tmp file. However, I
still don't understand the mechanism and I still don't know how to do it
in a single script. It appears that you have to provide a file path for
the <img src . . . tag. Can you do that *within* a script without
creating a tmp file somehow?

Regards, Frank

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Joe Conway 2002-04-01 21:22:05 Re: How to send bytea data straight to browser (as in pg_loreadall)?
Previous Message Frank Joerdens 2002-04-01 18:31:01 How to send bytea data straight to browser (as in pg_loreadall)?