aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/js
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-18 21:12:50 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-18 21:12:50 +0200
commit3df9f8a6fc959eaa0924722ad9ce0675d80369f9 (patch)
tree7dcbca18a2d2b417f477ec61d02322c9e5a7145b /frontend/js
parent19efa5bcdb745205ef5a6812480890968a17d1a9 (diff)
downloadSurfer-3df9f8a6fc959eaa0924722ad9ce0675d80369f9.tar.gz
Surfer-3df9f8a6fc959eaa0924722ad9ce0675d80369f9.tar.zst
Surfer-3df9f8a6fc959eaa0924722ad9ce0675d80369f9.zip
Do not error if a user tries to upload a file without a type
Diffstat (limited to 'frontend/js')
-rw-r--r--frontend/js/app.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js
index b68b608..dce3a60 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -136,6 +136,9 @@ function uploadFiles(files) {
136 app.uploadStatus.percentDone = 0; 136 app.uploadStatus.percentDone = 0;
137 137
138 asyncForEach(files, function (file, callback) { 138 asyncForEach(files, function (file, callback) {
139 // do not handle directories (file.type is empty in such a case)
140 if (file.type === '') return callback();
141
139 var path = encode(sanitize(app.path + '/' + (file.webkitRelativePath || file.name))); 142 var path = encode(sanitize(app.path + '/' + (file.webkitRelativePath || file.name)));
140 143
141 var formData = new FormData(); 144 var formData = new FormData();