diff options
Diffstat (limited to 'apps/files/js/jquery.fileupload.js')
-rw-r--r-- | apps/files/js/jquery.fileupload.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files/js/jquery.fileupload.js b/apps/files/js/jquery.fileupload.js index ea8529f3226..cc0c97ba3ed 100644 --- a/apps/files/js/jquery.fileupload.js +++ b/apps/files/js/jquery.fileupload.js @@ -1029,7 +1029,12 @@ } else { paramNameSet = paramName; } - data.originalFiles = files; + data.originalFiles = []; + $.each(files, function (file) { + if (!file.isDirectory) { + data.originalFiles.push(file); + } + }); $.each(fileSet || files, function (index, element) { var newData = $.extend({}, data); newData.files = fileSet ? element : [element]; @@ -1098,7 +1103,12 @@ entries, path + entry.name + '/' ).done(function (files) { - dfd.resolve(files); + // empty folder + if (!files.length && entry.isDirectory) { + dfd.resolve(entry); + } else { + dfd.resolve(files); + } }).fail(errorHandler); }, readEntries = function () { @@ -1486,4 +1496,4 @@ }); -}));
\ No newline at end of file +})); |