From: Jerome Jutteau Date: Mon, 23 Mar 2015 12:48:49 +0000 (+0100) Subject: f.php fix bad file name when browser cannot preview file X-Git-Tag: 1.1~132 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/a80b0189a72e4d5e3982ed7c4f47bdda09e3def2?ds=inline 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 --- 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. */