pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Joerdens <frank@joerdens.de>
To: Frank Joerdens <frank@joerdens.de>
Cc: pgsql-php@postgresql.org
Cc: adam@archi-me-des.de
Cc: linuxkurs@fas-art.com
Subject: Re: How to send bytea data straight to browser (as in pg_loreadall)?
Date: Mon, 1 Apr 2002 21:09:37 +0200
Message-ID: <20020401210937.B13198@superfly.archi-me-des.de> (raw)
In-Reply-To: <20020401203101.A13198@superfly.archi-me-des.de>
References: <20020401203101.A13198@superfly.archi-me-des.de>

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



view thread (3+ messages)  latest in thread

Message-ID: <20020401210937.B13198@superfly.archi-me-des.de>
Permalink:  ../20020401210937.B13198@superfly.archi-me-des.de/
Also on:    postgresql.org/message-id/20020401210937.B13198@superfly.archi-me-des.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: frank@joerdens.de, adam@archi-me-des.de, linuxkurs@fas-art.com
  Subject: Re: How to send bytea data straight to browser (as in pg_loreadall)?
  In-Reply-To: <20020401210937.B13198@superfly.archi-me-des.de>
  References: <20020401203101.A13198@superfly.archi-me-des.de> <20020401210937.B13198@superfly.archi-me-des.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox