summaryrefslogtreecommitdiffstats
path: root/apps/files/download.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-12-25 14:29:29 +0100
committerRobin Appelman <icewind@owncloud.com>2012-12-25 14:29:29 +0100
commit7e36f730ecfe452681f44771b28d1d3c4a5535df (patch)
tree578e604c170219151239e2da345d332b079ed920 /apps/files/download.php
parentbf05ff351faa693337107ed4a316e36e9aacd296 (diff)
parent5d59ac07391841677e204958ea20be3fe05cd8ef (diff)
downloadnextcloud-server-7e36f730ecfe452681f44771b28d1d3c4a5535df.tar.gz
nextcloud-server-7e36f730ecfe452681f44771b28d1d3c4a5535df.zip
merge master into filesystem
Diffstat (limited to 'apps/files/download.php')
-rw-r--r--apps/files/download.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/download.php b/apps/files/download.php
index dd356b27e9b..ddd23df4125 100644
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -40,7 +40,12 @@ if(!\OC\Files\Filesystem::file_exists($filename)) {
$ftype=\OC\Files\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\Files\Filesystem::filesize($filename));