summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-30 16:34:35 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-30 16:34:35 +0200
commit5699fff8893d38a3524013266a0b7e94be79bb31 (patch)
treeae72aa93fb2c37506cd3ee4216752b8f3b7a58ef /apps/files/ajax
parent22fd04eb4117e80341becce13190d5a8fcea98ca (diff)
parent009d1f3214f76cf1ae2318504449110104e159fb (diff)
downloadnextcloud-server-5699fff8893d38a3524013266a0b7e94be79bb31.tar.gz
nextcloud-server-5699fff8893d38a3524013266a0b7e94be79bb31.zip
Merge pull request #17175 from owncloud/add-download-feedback
Add loading spinner to download icon
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/download.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index e67635ab853..26bab8837b4 100644
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -39,4 +39,15 @@ if (!is_array($files_list)) {
$files_list = array($files);
}
+/**
+ * this sets a cookie to be able to recognize the start of the download
+ * the content must not be longer than 32 characters and must only contain
+ * alphanumeric characters
+ */
+if(isset($_GET['downloadStartSecret'])
+ && !isset($_GET['downloadStartSecret'][32])
+ && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) {
+ setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
+}
+
OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');