diff options
author | Piotr Filiciak <piotr@filiciak.pl> | 2016-05-20 18:16:44 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-20 18:16:44 +0200 |
commit | 9999e05660637c77947c71656d2f03d841e19ab9 (patch) | |
tree | 3eac375c092a2013e7d9fdb6be8d0f74d298defd /apps/files/ajax/download.php | |
parent | 59a85a4c76b80658d9373e3acf4f71b872b244a0 (diff) | |
download | nextcloud-server-9999e05660637c77947c71656d2f03d841e19ab9.tar.gz nextcloud-server-9999e05660637c77947c71656d2f03d841e19ab9.zip |
Http Range requests support in downloads
Http range requests support is required for video preview
Diffstat (limited to 'apps/files/ajax/download.php')
-rw-r--r-- | apps/files/ajax/download.php | 11 |
1 files changed, 10 insertions, 1 deletions
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); |