Output binary Images/large objects??
| From: | (Ed Blincoe) | Date: | Sat, 22 Jan 2000 01:01:58 +0000 |
| Subject: | Output binary Images/large objects?? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14804@lists.php.net to get a copy of this message | ||
I need to output binary images from a postgres large object field to a
browser, I attemped the following but it outputs rubbish. {i.e. untranslated
binary tosh}
------------- begin php3 file ---------------------
<html>
<body>
<?
$conn = pg_Connect("host=localhost port=5432 dbname=doc");
pg_exec($conn, "begin");
$news = pg_Exec($conn,"select
text_id,display_num,brand_num,page_num,content_obj from tblcontent");
#$news = pg_Exec($conn,"select
text_id,display_num,brand_num,page_num,content_obj from tblcontent");
$result_news = pg_NumRows($news);
$i = 0;
while($i < $result_news)
{
$name = pg_Result($news,$i,"text_id");
$email = pg_Result($news,$i,"display_num");
$date = pg_Result($news,$i,"brand_num");
$blurb = pg_Result($news,$i,"page_num");
$ctobj = pg_Result($news,$i,"content_obj");
$fhandle = pg_loopen($conn,$ctobj,"r");
$img1 = pg_loreadall($fhandle);
$size = pg_loread($fhandle);
echo "<img scr=./gobber.jpg>";
echo "$img1";
$i++;
}
pg_exec($conn, "end");
?>
</body>
</html>
-------------------------End----------------------------
Any suggestions how this can be output directly to a web page or does this
need to go through the icon/images directory in some way??
--
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net
To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net
To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin@lists.php.net