Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3749D475B47 for ; Sun, 27 Oct 2002 17:37:49 -0500 (EST) Received: from mailout08.sul.t-online.com (mailout08.sul.t-online.com [194.25.134.20]) by postgresql.org (Postfix) with ESMTP id A538C475AD7 for ; Sun, 27 Oct 2002 17:37:48 -0500 (EST) Received: from fwd09.sul.t-online.de by mailout08.sul.t-online.com with smtp id 185w2V-00068K-04; Sun, 27 Oct 2002 23:37:47 +0100 Received: from fraxinus.reticulum (520013531845-0001@[217.225.155.13]) by fmrl09.sul.t-online.com with esmtp id 185w2O-1b71vsC; Sun, 27 Oct 2002 23:37:40 +0100 Received: from ks by fraxinus.reticulum with local (Exim 3.35 #1 (Debian)) id 185vtL-0000vl-00 for ; Sun, 27 Oct 2002 23:28:19 +0100 Date: Sun, 27 Oct 2002 23:28:18 +0100 From: knut.suebert@web.de To: pgsql-php@postgresql.org Subject: Re: How do I display an image? Message-ID: <20021027222818.GA3523@fraxinus.reticulum> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-No-Archive: yes X-Sender: 520013531845-0001@t-dialin.net X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/66 X-Sequence-Number: 1581 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);