date('Ymd') || filesize($file)<=500 ) { $page=getUrl(WEBSERVICE_URI.'pdf/kbis-'.$siren.'.pdf', '', '', '', false); $body=$page['body']; $fp=@fopen($file, 'w'); @fwrite($fp, $body); @fclose($fp); } } elseif (substr($_REQUEST['ref'],0,4)=='rncs') { $ref=substr($_REQUEST['ref'],5,strlen($_REQUEST['ref'])-5); $file= PATH_DATA.'/pdf/rncs-'.$siren.'-'.$ref.'.pdf'; } else { $ref=$_REQUEST['ref']; $file= PATH_DATA.'/pdf/acte-'.$siren.'-'.$ref.'.pdf'; } $filename=basename($file); $body=file_get_contents($file); header("Pragma: public"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: must-revalidate"); header("Content-type: application/pdf"); header("Content-Length: ".strlen($body)); header('Content-disposition: inline; filename="'.$filename.'"');// attachement or inline header("Accept-Ranges: ".strlen($body)); echo $body; } ?>