Re: How to send bytea data straight to browser (as in pg_loreadall)? - Mailing list pgsql-php

From Frank Joerdens
Subject Re: How to send bytea data straight to browser (as in pg_loreadall)?
Date
Msg-id 20020401210937.B13198@superfly.archi-me-des.de
Whole thread Raw
List 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

pgsql-php by date:

Previous
From: Tomaz Borstnar
Date:
Subject: Many "pq_flush: send() failed: Broken pipe" after upgrading from php 4.0.x to php 4.1.x
Next
From: Frank Joerdens
Date:
Subject: How to send bytea data straight to browser (as in pg_loreadall)?