From 9482d9ee0e4287df21339be4276125e38e048951 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 10 Aug 2019 16:50:03 -0600 Subject: [PATCH] Delete secure_download.php --- resources/secure_download.php | 91 ----------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 resources/secure_download.php diff --git a/resources/secure_download.php b/resources/secure_download.php deleted file mode 100644 index ce61e9a085..0000000000 --- a/resources/secure_download.php +++ /dev/null @@ -1,91 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2012 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ -include "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; - -//clears if file exists cache -clearstatcache(); - - -function getDownloadFilename($strfile) { - // Get download file name and path - //$basedir = "c:\\products\\"; - //$basedir = "/home/wwwbeta/secure/files/"; - $basedir = "c:/www/demo.netprofx.com/secure/files/"; - // Build and return download file name - return $basedir . $strfile; -} - -function DownloadFile($filename) { - // Check filename - if (empty($filename) || !file_exists($filename)) { - echo "Error: file doesn't exist or is empty.
\n $filename"; - return FALSE; - } - - $file_extension = strtolower(substr(strrchr($filename,"."),1)); - switch ($file_extension) { - case "pdf": $ctype="application/pdf"; break; - case "exe": $ctype="application/octet-stream"; break; - case "zip": $ctype="application/zip"; break; - case "doc": $ctype="application/msword"; break; - case "xls": $ctype="application/vnd.ms-excel"; break; - case "ppt": $ctype="application/vnd.ms-powerpoint"; break; - case "gif": $ctype="image/gif"; break; - case "png": $ctype="image/png"; break; - case "jpe": case "jpeg": - case "jpg": $ctype="image/jpg"; break; - default: $ctype="application/force-download"; - } - - //if (!file_exists($filename)) { - // die("NO FILE HERE
$filename"); - //} - - // Create download file name to be displayed to user - $saveasname = basename($filename); - - header("Expires: 0"); - header("Pragma: public"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - header("Cache-Control: private",false); - header("Content-Type: $ctype"); - header("Content-Disposition: attachment; filename=\"".basename($filename)."\";"); - header("Content-Transfer-Encoding: binary"); - header("Content-Length: ".@filesize($filename)); - - set_time_limit(0); - @readfile($filename) or die("File not found."); - - // Done - return TRUE; -} - - - -?>