From: | Grant <grant(at)conprojan(dot)com(dot)au> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Subject: | Postgresql + Sessions + Large objects |
Date: | 2001-07-30 23:53:39 |
Message-ID: | Pine.LNX.4.21.0107310952510.12421-100000@webster.conprojan.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
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 that the file is not available. 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;"); }
}
p.s. This has been posted on www.phpbuilder.com
From | Date | Subject | |
---|---|---|---|
Next Message | Gyozo Papp | 2001-07-31 07:54:48 | Re: A function for building a where clause. |
Previous Message | Gyozo Papp | 2001-07-30 18:58:32 | Re: calling pl/pgsql stored procs from php |