From 46f1a1c319a6fa5f23733bc567b49a99212933a7 Mon Sep 17 00:00:00 2001 From: mattpass Date: Sun, 10 May 2020 15:47:26 +0100 Subject: [PATCH] classes expanded --- lib/download.php | 25 ++++++++----------------- lib/icecoder.php | 4 ++++ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/download.php b/lib/download.php index 4b15235..1085d96 100644 --- a/lib/download.php +++ b/lib/download.php @@ -1,26 +1,17 @@ ICEcoder.message('Sorry, that file doesn\'t appear to exist');"); } -if (true === file_exists($file)) { - header("Pragma: public"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); - header("Cache-Control: public"); - header('Content-Description: File Transfer'); - header("Content-Type: application/octet-stream"); - header('Content-Disposition: attachment; filename=' . basename($file)); - // header("Content-Transfer-Encoding: binary"); - header('Content-Length: ' . filesize($file)); - ob_clean(); - flush(); - readfile($file); +if (true === file_exists($filePath)) { + $file = new File(); + $file->download($filePath); exit; } diff --git a/lib/icecoder.php b/lib/icecoder.php index 704ae51..1b4d144 100644 --- a/lib/icecoder.php +++ b/lib/icecoder.php @@ -1,7 +1,11 @@