Re: How do I display an image? - Mailing list pgsql-php

From knut.suebert@web.de
Subject Re: How do I display an image?
Date
Msg-id 20021027222818.GA3523@fraxinus.reticulum
Whole thread Raw
In response to How do I display an image?  ("Patrick Hatcher" <PHatcher@macys.com>)
List pgsql-php
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);

pgsql-php by date:

Previous
From: Andrew McMillan
Date:
Subject: Re: Problems with OIDs
Next
From: Carlos García Gómez
Date:
Subject: Re: Problems with OIDs