Re: OID output problems

Поиск
Список
Период
Сортировка
Искать
От
surfer girl
Тема
Re: OID output problems
Дата
в 22:47:15
Msg-id
20000503024320.1E64040B9@sitemail.everyone.net
Список
Дерево обсуждения
Re: OID output problems Ron Chmara <ron@opus1.com>
Hi Robert, 

Thanks for the code. I tried the code, and it works fine (no errors) except instead of getting an image output, it outputs "/tmp/php08543baa" to the browser or something similar (just like my code). Am I missing something where I should be transferring a temp file to something web-readable - or is my Postgres doing something funny? Sorry if this sounds dense but I've followed a number of examples and I thought the actual image was supposed to be sent directly to the browser using pg_loreadall.

Thanks again!


--- "Robert B. Easter"  wrote:
>/*
>        Takes arg: imageid=oid of image
>*/
>
>$conn = pg_pconnect("user=username dbname=databasename");
>
>pg_exec($conn, "begin");
>@ $fd = pg_loopen($conn, $imageid, "r");
>if($fd) {
>        $hdr = pg_loread($fd, 4);
>        switch($hdr) {
>                case "\xFF\xD8\xFF\xE0":
>                        Header( "Content-type: image/jpeg" );
>                        break;
>                case "GIF8":
>                        Header( "Content-type: image/gif" );
>                        break;
>                case "\x89PNG":
>                        Header( "Content-type: image/png" );
>                        break;
>        }
>        echo $hdr;
>        pg_loreadall($fd);
>        pg_exec($conn, "end");
>}
>else {
>        echo "Query rejected.";
>}
>
>pg_close($conn);
>?>
>-------------------------------------------------------------------------------
>-- 
>Robert B. Easter
>reaster@comptechnews.com

_____________________________________________________________
Get YourName@getitgear.com email Today!
Visit http://mail.getitgear.com
В списке pgsql-general по дате отправления
От: Robert B. Easter
Дата:
Сообщение: Re: Enumerated data type
От: Robert B. Easter
Дата:
Сообщение: Re: OID output problems
FAQ