summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-07 14:15:02 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-07 14:15:02 +0100
commit4a4f705adc32831c4e90422598dbe0e89c6acd80 (patch)
treee3107d1554f22b878eea29005cf183e487882a1e /apps
parent97222b1de5349ac31abf518b7fd762b24947e237 (diff)
downloadnextcloud-server-4a4f705adc32831c4e90422598dbe0e89c6acd80.tar.gz
nextcloud-server-4a4f705adc32831c4e90422598dbe0e89c6acd80.zip
json encode list of files
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/download.php9
-rw-r--r--apps/files/js/files.js5
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php
index b9a4ddaf5e7..163232ef001 100644
--- a/apps/files/ajax/download.php
+++ b/apps/files/ajax/download.php
@@ -33,4 +33,11 @@ OCP\User::checkLoggedIn();
$files = $_GET["files"];
$dir = $_GET["dir"];
-OC_Files::get($dir, $files, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+$files_list = json_decode($files);
+if ($files_list === NULL ) {
+ $files_list = array($files);
+}
+
+foreach ($files_list as $f) error_log("file: $f");
+
+OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 464f7703685..a4ef41c2803 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -220,14 +220,15 @@ $(document).ready(function() {
});
$('.download').click('click',function(event) {
- var files=getSelectedFiles('name').join(';');
+ var files=getSelectedFiles('name');
+ var fileslist = JSON.stringify(files);
var dir=$('#dir').val()||'/';
OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
// use special download URL if provided, e.g. for public shared files
if ( (downloadURL = document.getElementById("downloadURL")) ) {
window.location=downloadURL.value+"&download&files="+files;
} else {
- window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: files });
+ window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist });
}
return false;
});