Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Filiciak <piotr@filiciak.pl>2016-05-20 19:16:44 +0300
committerVincent Petry <pvince81@owncloud.com>2016-05-20 19:16:44 +0300
commit9999e05660637c77947c71656d2f03d841e19ab9 (patch)
tree3eac375c092a2013e7d9fdb6be8d0f74d298defd /apps/files/ajax
parent59a85a4c76b80658d9373e3acf4f71b872b244a0 (diff)
Http Range requests support in downloads
Http range requests support is required for video preview
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/download.php11
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);