From 409b5108896edda9adf916cd566dbce2d2b00351 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 10 Dec 2013 12:05:39 +0100 Subject: Moved content disposition code+workarounds to OCP\Response Added new OC\Response API called setContentDispositionHeader() that contains the needed workarounds for UTF8 and IE. Refactored download code to use the new API. Removed unused trashbin download file. --- apps/files/download.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'apps/files/download.php') diff --git a/apps/files/download.php b/apps/files/download.php index e3fe24e45d7..6b055e99a53 100644 --- a/apps/files/download.php +++ b/apps/files/download.php @@ -37,12 +37,7 @@ if(!\OC\Files\Filesystem::file_exists($filename)) { $ftype=\OC\Files\Filesystem::getMimeType( $filename ); header('Content-Type:'.$ftype); -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::setContentDispositionHeader(basename($filename), 'attachment'); OCP\Response::disableCaching(); header('Content-Length: '.\OC\Files\Filesystem::filesize($filename)); -- cgit v1.2.3