From 4188f38ad56d7ba2ea46e94403f305243514f80c Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 24 Jul 2014 15:49:36 +0200 Subject: add pdf and mobi libraries --- inc/3rdparty/libraries/mpdf/includes/out.php | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 inc/3rdparty/libraries/mpdf/includes/out.php (limited to 'inc/3rdparty/libraries/mpdf/includes/out.php') diff --git a/inc/3rdparty/libraries/mpdf/includes/out.php b/inc/3rdparty/libraries/mpdf/includes/out.php new file mode 100644 index 00000000..75da4553 --- /dev/null +++ b/inc/3rdparty/libraries/mpdf/includes/out.php @@ -0,0 +1,59 @@ +Error('Some data has already been output to browser, can\'t send PDF file'); + header('Content-Transfer-Encoding: binary'); + header('Cache-Control: public, must-revalidate, max-age=0'); + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream', false); + header('Content-Type: application/download', false); + header('Content-Type: application/pdf', false); + header('Content-disposition: attachment; filename="'.$name.'"'); + } + $filesize = filesize($path.$tempfilename); + if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { + // don't use length if server using compression + header('Content-Length: '.$filesize); + } + $fd=fopen($path.$tempfilename,'rb'); + fpassthru($fd); + fclose($fd); + unlink($path.$tempfilename); + // ====================== DELETE OLD FILES - Housekeeping ========================================= + // Clear any files in directory that are >24 hrs old + $interval = 86400; + if ($handle = opendir(dirname($path.'dummy'))) { + while (false !== ($file = readdir($handle))) { + if (((filemtime($path.$file)+$interval) < time()) && ($file != "..") && ($file != ".") && substr($file, -3)=='pdf') { + unlink($path.$file); + } + } + closedir($handle); + } + exit; + } +?> \ No newline at end of file -- cgit v1.2.3