00001 <?php
00002 include('../include/init/init.php');
00003
00004 $PgDbConn=pg_connect(
00005 "dbname=".$CONFIG["DB"]['DBNAME'].
00006 " user=".$CONFIG["DB"]['USER'].
00007 " password=".$CONFIG["DB"]['PASSWORD'].
00008 " host=".$CONFIG["DB"]['HOST']
00009 )
00010 or die("Can't connect!");
00011
00012 pg_query($PgDbConn,'BEGIN;');
00013
00014 error_reporting(E_PARSE);
00015 $lo=pg_lo_open($PgDbConn,$_GET["loid"],'r');
00016 if($lo){
00017 header("Content-type: ".$_GET["mime-type"]);
00018 pg_lo_read_all($lo);
00019 pg_lo_close($lo);
00020 }
00021 else{
00022 header('header("HTTP/1.0 404 Not Found");');
00023 ?>
00024 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
00025 <html><head>
00026 <title>404 Not Found</title>
00027 </head><body>
00028 <h1>Not Found</h1>
00029 The requested URL <?=$_SERVER["REQUEST_URI"] ?> was not found on this server.<p>
00030 <hr>
00031 <?=$_SERVER["SERVER_SIGNATURE"]?>
00032 </body></html>
00033 <?php
00034 }
00035
00036 pg_query($PgDbConn,'END;');
00037 ?>