diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-12-10 15:05:39 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-08 01:11:22 +0400 |
commit | c9cb258616b038f82a9f5e5ecc1776bf924d0314 (patch) | |
tree | 71d37cee32015098e310bb675876eedc51533fa6 /apps/files_versions | |
parent | 697ad1ca9ef104eeedbe7f03ef8018634304afcd (diff) |
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.
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/download.php | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php index 040a662e61b..2fe56d2e638 100644 --- a/apps/files_versions/download.php +++ b/apps/files_versions/download.php @@ -36,12 +36,7 @@ $view = new OC\Files\View('/'); $ftype = $view->getMimeType('/'.$uid.'/files/'.$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: '.$view->filesize($versionName)); |