diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-12-31 15:47:15 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-12-31 15:47:15 +0000 |
commit | 6eb194b70284d527a182756f2c7a21f3d7dc1fe8 (patch) | |
tree | e70635e44cc4fccbbde34bed1a01fd50fcd183cf /lib/files.php | |
parent | 218a5ea89014322592bd8c4789d8500d42029b9f (diff) | |
parent | 329bddab481129b480ca187b694e507eff7fb125 (diff) | |
download | nextcloud-server-6eb194b70284d527a182756f2c7a21f3d7dc1fe8.tar.gz nextcloud-server-6eb194b70284d527a182756f2c7a21f3d7dc1fe8.zip |
Merge branch 'master' into ocs_api
Conflicts:
l10n/templates/core.pot
l10n/templates/files.pot
l10n/templates/files_encryption.pot
l10n/templates/files_external.pot
l10n/templates/files_sharing.pot
l10n/templates/files_versions.pot
l10n/templates/lib.pot
l10n/templates/settings.pot
l10n/templates/user_ldap.pot
l10n/templates/user_webdavauth.pot
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/files.php b/lib/files.php index 152ed8f34a7..69097e41074 100644 --- a/lib/files.php +++ b/lib/files.php @@ -197,7 +197,12 @@ class OC_Files { } OC_Util::obEnd(); if($zip or OC_Filesystem::is_readable($filename)) { - 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) ) . '"' ); + } header('Content-Transfer-Encoding: binary'); OC_Response::disableCaching(); if($zip) { @@ -207,6 +212,7 @@ class OC_Files { self::addSendfileHeader($filename); }else{ header('Content-Type: '.OC_Filesystem::getMimeType($filename)); + header("Content-Length: ".OC_Filesystem::filesize($filename)); $storage = OC_Filesystem::getStorage($filename); if ($storage instanceof OC_Filestorage_Local) { self::addSendfileHeader(OC_Filesystem::getLocalFile($filename)); @@ -222,8 +228,6 @@ class OC_Files { die('403 Forbidden'); } if($only_header) { - if(!$zip) - header("Content-Length: ".OC_Filesystem::filesize($filename)); return ; } if($zip) { |