From 9999e05660637c77947c71656d2f03d841e19ab9 Mon Sep 17 00:00:00 2001 From: Piotr Filiciak Date: Fri, 20 May 2016 18:16:44 +0200 Subject: Http Range requests support in downloads Http range requests support is required for video preview --- apps/files/ajax/download.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'apps/files/ajax/download.php') diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index 28ce4c6542e..aedd86b6419 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -50,4 +50,13 @@ if(isset($_GET['downloadStartSecret']) setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); } -OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD'); +$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() == 'HEAD' ); + +/** + * Http range requests support + */ +if (isset($_SERVER['HTTP_RANGE'])) { + $server_params['range'] = \OC::$server->getRequest()->getHeader('Range'); +} + +OC_Files::get($dir, $files_list, $server_params); -- cgit v1.2.3