Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id A835F475D49 for ; Mon, 1 Apr 2002 16:21:52 -0500 (EST) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.6) with ESMTP-TLS id 315822; Mon, 01 Apr 2002 13:14:57 -0800 Message-ID: <3CA8CF7D.9060303@joeconway.com> Date: Mon, 01 Apr 2002 13:22:05 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Frank Joerdens Cc: pgsql-php@postgresql.org, adam@archi-me-des.de, linuxkurs@fas-art.com Subject: Re: How to send bytea data straight to browser (as in pg_loreadall)? References: <20020401203101.A13198@superfly.archi-me-des.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/3 X-Sequence-Number: 1027 Frank Joerdens wrote: > I've played with fgets, fwrite, fputs, fpassthrough, trying to make a > file pointer on stdout with fopen . . . it appears that I don't > understand some crucial point about how this works. How do you present > an image to the browser without actually creating a file for it? The > built in function pg_loreadall appears to do exactly that. I'd need to > replicate that functionality for bytea. > > Regards, Frank I've always approached this a bit differently, but in any case, did you try to use "php://stdout"? If not see: http://www.php.net/manual/en/function.fopen.php I usually create one php file to generate the image output, and a second one which calls the first. E.g. (untested) ---------------------- begin showimgage.php ---------------------- ---------------------- showimgage.php ---------------------- The second file would then have a line like: echo ""; Hope this helps, Joe