From: | Vic <vic(at)dcc(dot)dp(dot)ua> |
---|---|
To: | algobit(at)algobit(dot)com |
Cc: | ML-Postgres-Interfaces <Pgsql-Interfaces(at)Postgresql(dot)org> |
Subject: | Re: PHP & Large Object |
Date: | 2000-09-20 00:19:16 |
Message-ID: | 39C80284.819CA13@dcc.dp.ua |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Hi Enrico!
I try many times this sample with one result - image was
fill browser as
"sequence of chars" - i see "dirty screen". I start from
Postgres 6.5.3 and 1.3.6 with PHP 3.0.17,
but in other versions - systems i get a same result .
And in febrary this year I found in one conf sample --- it
work in my intranet.
Try it. I think this trouble must be fixsed and sample added in
FAQ :-) )
>----------------------------------------------------------------------------------------------------------------------------------
FILE "image.php3"
<?
$db=pg_connect( "dbname=storage host=localhost user=pvic password=1");
$result=pg_exec( "select image from alldoc where n=$id");
$array=pg_fetch_array($result,0);
$oid=$array["image"];
header( "content-type: image/jpeg");
/* O this proc descr i don't found in any doc but i sure -- it
pump to browser type of BLOB */
if($oid) {
pg_exec( "begin");
$handle=pg_loopen($db,$oid, "r");
if($handle){
pg_loreadall($handle);
}
pg_loclose($handle);
pg_exec($db, "commit");
pg_exec($db, "end");
}
?>
>----------------------------------------------------------------------------------------------------------------------------------
FILE "ti.htm"
<HTML>
<BODY>
<img src="image.php3?id=3">
</BODY>
</HTML>
>----------------------------------------------------------------------------------------------------------------------------------
Bye.
Vic
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Samplonius | 2000-09-20 04:20:59 | Re: PHP & Large Object |
Previous Message | Kirby Bohling (TRSi) | 2000-09-19 22:59:06 | cursor interface to libpq |