Received: from smtp.web.de (pop3.web.de [212.227.116.81]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f2I5QWx67497 for ; Sun, 18 Mar 2001 00:26:32 -0500 (EST) (envelope-from knut.suebert@web.de) Received: from cascal.vtb by smtp.web.de with smtp (freemail 4.2.1.6 #6) id m14eVi3-000tZZC; Sun, 18 Mar 2001 06:26 +0100 Received: from ksueber by cascal.vtb with local (Exim 3.22 #1 (Debian)) id 14eVeF-0005UX-00 for ; Sun, 18 Mar 2001 06:22:35 +0100 Date: Sun, 18 Mar 2001 06:22:35 +0100 To: pgsql-php@postgresql.org Subject: faster way to display jpg-blobs? Message-ID: <20010318062235.A20520@cascal.vtb> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.12i From: Knut Suebert X-Archive-Number: 200103/25 X-Sequence-Number: 209 Hello, I'm new to this list. And I have the following question: is there a better/faster way than the following to read jpeg-blobs out of the database and display them? if( $db->next_record() ){ header("Content-Type: image/jpeg"); $bild = $db->lo_read($db->f("oid")); header("Content-Length: 1024000"); // has to be calculated print($bild); } where lo_read() is function lo_read($oid, $mode="r"){ $this->connect(); pg_exec($this->Link_ID, "begin"); // a must for blob-operations if( $lo_id = pg_loopen( $this->Link_ID, $oid, $mode ) ){ $lo = pg_loread( $lo_id, 1024000 ); // has to be calculated pg_loclose($lo_id); } pg_exec($this->Link_ID, "end"); return $lo; // empty leer, wenn auslesen gescheitert } Because of the begin/end every picture on a page is loaded one after the other, I fear. Not simultaneous as if there would be a direct instead of . Using blobs is a must IMHO, as viewing the pics should only be possible for authorized people. Thanks, bye, Knut