aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/resources/js/files.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/resources/js/files.js b/src/main/resources/js/files.js
index baed543..1247ed1 100644
--- a/src/main/resources/js/files.js
+++ b/src/main/resources/js/files.js
@@ -48,9 +48,12 @@ drop.addEventListener('drop', e => {
});
} else {
subItem.file(subFile => {
- // TODO: Add support for nested directory upload with more than 1 layer
+ // TODO: Add support for nested directory upload with more than 1 layer - via webkitRelativePath on firefox?
formData.append("file", subFile);
- request.open("POST", `/upload/${path}/${file.name}`);
+ console.log(subFile);
+ console.log(file);
+ if (subFile.webkitRelativePath === "") request.open("POST", `/upload/${path}/${file.name}`);
+ else request.open("POST", `/upload/${path}`);
request.send(formData);
})
}