From a80b0189a72e4d5e3982ed7c4f47bdda09e3def2 Mon Sep 17 00:00:00 2001 From: Jerome Jutteau Date: Mon, 23 Mar 2015 13:48:49 +0100 Subject: [PATCH] f.php fix bad file name when browser cannot preview file This permits to have the original file name when browser force user to download the file because he cannot preview it. closes #24 --- f.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/f.php b/f.php index e1c858e..9bbe4d9 100644 --- a/f.php +++ b/f.php @@ -220,8 +220,9 @@ if ($cfg['download_page'] && !$password_challenged && !$do_download && !$do_prev header ('HTTP/1.0 200 OK'); header ('Content-Length: ' . $link['file_size']); if (!jirafeau_is_viewable ($link['mime_type']) || !$cfg['preview'] || $do_download) - header ('Content-Disposition: attachment; filename="' . - $link['file_name'] . '"'); + header ('Content-Disposition: attachment; filename="' . $link['file_name'] . '"'); +else + header ('Content-Disposition: filename="' . $link['file_name'] . '"'); header ('Content-Type: ' . $link['mime_type']); /* Read encrypted file. */ -- 2.34.1