Re: How do I display an image?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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);


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux