From 4f047de2aa122054a82d4999d411c9d0a2bce9ab Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Tue, 30 Oct 2007 00:35:18 +0000 Subject: [PATCH] making multibyte filename appear correctly under IE download --- lib/filelib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/filelib.php b/lib/filelib.php index 36145b8ecf..7a4f0ac300 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -345,6 +345,11 @@ function send_file($path, $filename, $lifetime=86400 , $filter=0, $pathisstring= //TODO: should we remove all those @ before the header()? Are all of the values supported on all servers? header('Last-Modified: '. gmdate('D, d M Y H:i:s', $lastmodified) .' GMT'); + // if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup + if (check_browser_version('MSIE')) { + $filename = urlencode($filename); + } + if ($forcedownload) { @header('Content-Disposition: attachment; filename='.$filename); } else { -- 2.39.5