Re: Postgresql + Sessions + Large objects.

From: Date: Sat, 04 Aug 2001 19:35:41 +0000
Subject: Re: Postgresql + Sessions + Large objects.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61264@lists.php.net to get a copy of this message
Do you have session db and your data db on the same db? If you do, most likely, transaction is started in session open handler. You cannot nest transaction and lo_read/open etc fails. If you have situation like this, create dedicated database for session db. Regards, -- Yasuo Ohgaki "Speedboy" <speedboy@nomicrosoft.org> wrote in message news:Pine.LNX.4.21.0108042153020.3263-100000@b.evark.com... > I am having trouble with the following function working _with_ > sessions. If I turn off my session checking function it enables you to > download the file flawlessly, if sessions are turned on then Internet > Explorer displays an error: > > Internet Explorer cannot download ...URL > > Internet Explorer was not able to open this Internet site. The requested > site is either unavailable or cannot be found. Please try again later. > > Is there a way I can download large objects from postgresql _with_ > sessions? Thankyou. > > function retrieve_file($id) { > global $dbconn1; > > $result1 = pg_exec ($dbconn1, "select data, file_name from files where > id='$id';"); > $image_oid = pg_result($result1 ,0, 'data'); > $file_name = pg_result($result1 ,0, 'file_name'); > > header ("Content-disposition: filename=\"$file_name\""); > header("Content-type: application/download"); > > pg_exec ($dbconn1, "begin transaction;"); > $image_handle = pg_loopen ($dbconn1, $image_oid, 'r'); > > pg_loreadall ($image_handle); pg_loclose ($image_handle); > pg_exec ($dbconn1, "commit transaction;"); } > } >

« previous php.general (#61264) next »