aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-18 21:07:53 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-18 21:07:53 +0200
commit35355283872739fb9bd150cf42a40a1a23b1674d (patch)
treed3bff4a615e57a1b69547d4437e7a8f438cdb348
parent09d1f4f5e8ae9b4bd65c6241a9c6cdfaeed200fa (diff)
downloadSurfer-35355283872739fb9bd150cf42a40a1a23b1674d.tar.gz
Surfer-35355283872739fb9bd150cf42a40a1a23b1674d.tar.zst
Surfer-35355283872739fb9bd150cf42a40a1a23b1674d.zip
Support uploading whole folder trees
-rw-r--r--frontend/index.html2
-rw-r--r--frontend/js/app.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/frontend/index.html b/frontend/index.html
index 5856a16..538d329 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -21,7 +21,7 @@
21<div id="app" @drop="drop" @dragover="dragOver"> 21<div id="app" @drop="drop" @dragover="dragOver">
22 22
23<el-container> 23<el-container>
24 <input type="file" ref="upload" style="display: none" id="uploadInput" multiple/> 24 <input type="file" ref="upload" style="display: none" id="uploadInput" multiple webkitdirectory="" directory=""/>
25 25
26 <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false"> 26 <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false">
27 <el-form :model="loginData" label-position="top" @submit.native.prevent> 27 <el-form :model="loginData" label-position="top" @submit.native.prevent>
diff --git a/frontend/js/app.js b/frontend/js/app.js
index 8970a0f..4cb57e3 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -136,7 +136,7 @@ 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 var path = encode(sanitize(app.path + '/' + file.name)); 139 var path = encode(sanitize(app.path + '/' + (file.webkitRelativePath || file.name)));
140 140
141 var formData = new FormData(); 141 var formData = new FormData();
142 formData.append('file', file); 142 formData.append('file', file);