pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: knut.suebert@web.de
To: pgsql-php@postgresql.org
Subject: Re: How do I display an image?
Date: Sun, 27 Oct 2002 23:28:18 +0100
Message-ID: <20021027222818.GA3523@fraxinus.reticulum> (raw)
In-Reply-To: <OF89E4C36B.5033CB75-ON88256C5B.0083CDB2-88256C5C.00006310@fds.com>
References: <OF89E4C36B.5033CB75-ON88256C5B.0083CDB2-88256C5C.00006310@fds.com>

Patrick Hatcher schrieb:

>          $row =  pg_fetch_array($result);
>          $type = "JPG";
>          Header( "Content-type:$type");
>          echo $row[0];

For most browsers that's enough, at least some versions of
InternetExplorer need more information:

   $data = $db->bytea_decode($db->f("data"));
   header(sprintf("Content-type: %s", $db->f("type")));
   header(sprintf("Content-Disposition: attachment; filename=%s",
                  $db->f("name")));
   header(sprintf("Content-length: %s", strlen($data)));
   print($data);



view thread (4+ messages)

Message-ID: <20021027222818.GA3523@fraxinus.reticulum>
Permalink:  ../20021027222818.GA3523@fraxinus.reticulum/
Also on:    postgresql.org/message-id/20021027222818.GA3523@fraxinus.reticulum

 · 

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: knut.suebert@web.de
  Subject: Re: How do I display an image?
  In-Reply-To: <20021027222818.GA3523@fraxinus.reticulum>
  References: <OF89E4C36B.5033CB75-ON88256C5B.0083CDB2-88256C5C.00006310@fds.com> <20021027222818.GA3523@fraxinus.reticulum>

* 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