diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2012-12-17 14:53:15 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2012-12-17 14:53:15 -0800 |
commit | b8f749420b8705792c412db14e8135abad86660b (patch) | |
tree | 14f8b203064a6f29daaa975f08b9b9d3147d4ce5 /apps/files | |
parent | d085fdf8ea01c3ad7d3cb6af5361e501404b3c41 (diff) | |
parent | b6eb95349e6e339c90f8165bcd0471bd6268f8c3 (diff) | |
download | nextcloud-server-b8f749420b8705792c412db14e8135abad86660b.tar.gz nextcloud-server-b8f749420b8705792c412db14e8135abad86660b.zip |
Merge pull request #929 from owncloud/fix_utf8_filenames_in_ie_download
fix utf8 filenames in ie download response header according to rfc5987, ...
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/download.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/download.php b/apps/files/download.php index 6475afb56e0..e2149cd4135 100644 --- a/apps/files/download.php +++ b/apps/files/download.php @@ -40,7 +40,12 @@ if(!OC_Filesystem::file_exists($filename)) { $ftype=OC_Filesystem::getMimeType( $filename ); header('Content-Type:'.$ftype); -header('Content-Disposition: attachment; filename="'.basename($filename).'"'); +if ( preg_match( "/MSIE/", $_SERVER["HTTP_USER_AGENT"] ) ) { + header( 'Content-Disposition: attachment; filename="' . rawurlencode( basename($filename) ) . '"' ); +} else { + header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode( basename($filename) ) + . '; filename="' . rawurlencode( basename($filename) ) . '"' ); +} OCP\Response::disableCaching(); header('Content-Length: '.OC_Filesystem::filesize($filename)); |