Re: Re: HTTP Download with Postgresl Blob

From: Date: Fri, 16 Jul 2004 09:03:47 +0000
Subject: Re: Re: HTTP Download with Postgresl Blob
References: 1 2  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-32102@lists.php.net to get a copy of this message
Michael Wallner wrote:
Hi Jeroen Houben, you wrote:
Is there a solution here, or do I just need to up my php memory limit? I was wondering if I could use HTTP download together with pg_lo_read_all(). I'd like to send all the right headers using HTTP_Download and then send the data using pg_lo_read_all(). Is that possible?
I had a quick look at the manual, and as there are only three database APIs providing LOBs as resources, it might be the best solution to write a stream wrapper... If you decide to write such a nifty solution, maybe PEAR could benefit from it too as Stream_LOB or such... ;) A stream wrapper? In C you mean, or in PHP code? I'm afraid I wouldn't know where to start...
Isn't there a way to make HTTP_Download send all the HTTP headers but *not* send the data? That way you can just "echo" whatever data you want as the binary data, without using setData() - this is a more manual approach but it's useful in this case. example: $dl = new HTTP_Download; $dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, $filename); $dl->setFilesize($filesize); $dl->setContentType($mimetype); $dl->sendHeadersOnly(); pg_lo_read_all($lo_resource); exit;

« previous php.pear.dev (#32102) next »