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;
+ window.location=downloadURL.value+"&download&files="+encodeURIComponent(fileslist);
} else {
window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist });
}
// Download the file
if (isset($_GET['download'])) {
if (isset($_GET['files'])) { // download selected files
- OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ $files = urldecode($_GET['files']);
+ $files_list = json_decode($files);
+ // in case we get only a single file
+ if ($files_list === NULL ) {
+ $files_list = array($files);
+ }
+ OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else {
OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}