feat: empty folder upload

This commit is contained in:
Ramires Viana 2020-06-16 18:00:27 +00:00
parent 7e6b4af48b
commit 6aa55259c4

View File

@ -419,6 +419,13 @@ export default {
}
})
} else if (entry.isDirectory) {
const dir = {
isDir: true,
path: `${directory}${entry.name}`
}
contents.push(dir)
readReaderContent(entry.createReader(), `${directory}${entry.name}`)
}
}
@ -461,9 +468,23 @@ export default {
for (let i = 0; i < files.length; i++) {
let file = files[i]
if (!file.isDir) {
let filename = (file.fullPath !== undefined) ? file.fullPath : file.name
let filenameEncoded = url.encodeRFC5987ValueChars(filename)
promises.push(api.post(this.$route.path + base + filenameEncoded, file, overwrite, onupload(i)))
} else {
let uri = this.$route.path + base;
let folders = file.path.split("/");
for (let i = 0; i < folders.length; i++) {
let folder = folders[i];
let folderEncoded = encodeURIComponent(folder);
uri += folderEncoded + "/"
}
api.post(uri);
}
}
let finish = () => {