Work with PDF
*************************************************************************************************** OPEN PDF SECURLY FROM OUTSIDE OF URL - IN BROWSER $pdf = 'Network Forensics.pdf'; ini_set('zlib.output_compression','Off'); 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-Disposition: inline; filename="'.$pdf.'"'); header('Content-Length: ' . filesize("c:\Network Forensics.pdf")); readfile("c:\path\Network Forensics.pdf"); *************************************************************************************************** OPEN PDF SECURLY FROM OUTSIDE OF URL - DOWNLOAD $DOCUMENTS = 'c:\\path\\'; $fileName = 'Windows Malware Analysis Essentials.pdf'; $path = $DOCUMENTS . $fileName; $size = filesize($path); $fp = fopen($path, "rb"); $content = fread($fp, $size); fclose($fp); header("Content-length: ".$size); header("Content-type: application/octet-stream"); header("Content-disposition: attachment; filename=". $fileName .";" ); echo $content; exit(); ***************************************************************************************************


@2024