var data = this.data;
var file = this.getFile();
+ // if file is a directory, just create it
+ // files are handled separately
+ if (file.isDirectory) {
+ return this.uploader.ensureFolderExists(OC.joinPaths(this._targetFolder, file.fullPath));
+ }
+
if (self.aborted === true) {
return $.Deferred().resolve().promise();
}
} 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];
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 () {
});
-}));
\ No newline at end of file
+}));