From 0385672364ed851b401d350a4df76cf6c9df46fc Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 13 Mar 2023 21:42:32 +1000 Subject: [PATCH] added content-disposition headers --- public/media.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/media.php b/public/media.php index d057c8b..6e23e2f 100644 --- a/public/media.php +++ b/public/media.php @@ -26,6 +26,7 @@ if ($filepath !== false && strlen($filepath) > 0 && strpos($_GET['url'], 'upload // Output the original image to the browser header('Content-Type: '. mime_content_type($filepath)); + header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . pathinfo($filepath, PATHINFO_EXTENSION)); readfile($filepath); } else { $newWidth = (isset($_GET['w']) ? intval($_GET['w']) : -1); @@ -71,6 +72,7 @@ if ($filepath !== false && strlen($filepath) > 0 && strpos($_GET['url'], 'upload } else { // Output the original image to the browser header('Content-Type: '. mime_content_type($filepath)); + header('Content-Disposition: inline; filename=' . pathinfo($filepath, PATHINFO_FILENAME) . pathinfo($filepath, PATHINFO_EXTENSION)); readfile($filepath); } }