Check(); if ( $User->admin == 0 ) { if (CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$jrn) == 0 ){ /* Cannot Access */ NoAccess(); exit -1; } } StartSql($cn); $ret=ExecSql($cn,"select jr_pj,jr_pj_name,jr_pj_type from jrn where jr_grpt_id=$jr_grpt_id"); if ( pg_num_rows ($ret) == 0 ) return; $row=pg_fetch_array($ret,0); $tmp=tempnam('/tmp/','document_'); pg_lo_export($cn,$row['jr_pj'],$tmp); header('Content-type: '.$row['jr_pj_type']); header('Content-Disposition: attachment;filename="'.$row['jr_pj_name'].'"',FALSE); $file=fopen($tmp,'r'); while ( !feof ($file) ) echo fread($file,8192); fclose($file); Commit($cn);