diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 442fdec93229b..39f448ab35047 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1051,7 +1051,7 @@ }; if(this.getSelectedFiles().length > 1) { - OCA.Files.Files.handleDownload(this.getDownloadUrl(files, dir, true), disableLoadingState); + OCA.Files.Files.handleDownload(this.getDownloadUrl(files, dir, true), disableLoadingState, files, dir); } else { var first = this.getSelectedFiles()[0]; diff --git a/apps/files/js/files.js b/apps/files/js/files.js index b0c3824818309..2dc2f4382d5f6 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -364,7 +364,7 @@ * @param {string} url download URL * @param {Function} callback function to call once the download has started */ - handleDownload: function(url, callback) { + handleDownload: function(url, callback, files = null, dir = null) { var randomToken = Math.random().toString(36).substring(2), checkForDownloadCookie = function() { if (!OC.Util.isCookieSetToValue('ocDownloadStarted', randomToken)){ @@ -380,6 +380,10 @@ } else { url += '?'; } + filesClient = OC.Files.getClient(); + filesClient = filesClient.getClient(); + // Method signature : request: function (method, url, headers, body, responseType, options) + filesClient.request('POST', url, [], []); OC.redirect(url + 'downloadStartSecret=' + randomToken); OC.Util.waitFor(checkForDownloadCookie, 500); }