]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
Support uploading whole folder trees
authorJohannes Zellner <johannes@cloudron.io>
Fri, 18 May 2018 19:07:53 +0000 (21:07 +0200)
committerJohannes Zellner <johannes@cloudron.io>
Fri, 18 May 2018 19:07:53 +0000 (21:07 +0200)
frontend/index.html
frontend/js/app.js

index 5856a1615587ef9397fe72095d968eab299abac6..538d32932afdc3edd077ece1900c24bd2c3ee447 100644 (file)
@@ -21,7 +21,7 @@
 <div id="app" @drop="drop" @dragover="dragOver">
 
 <el-container>
-  <input type="file" ref="upload" style="display: none" id="uploadInput" multiple/>
+  <input type="file" ref="upload" style="display: none" id="uploadInput" multiple  webkitdirectory="" directory=""/>
 
   <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false">
     <el-form :model="loginData" label-position="top" @submit.native.prevent>
index 8970a0f8b6c3d379fa6fba545bbcc51cfdac931d..4cb57e3b1b35163d1c72c04cd5e07e78d08d75ff 100644 (file)
@@ -136,7 +136,7 @@ function uploadFiles(files) {
     app.uploadStatus.percentDone = 0;
 
     asyncForEach(files, function (file, callback) {
-        var path = encode(sanitize(app.path + '/' + file.name));
+        var path = encode(sanitize(app.path + '/' + (file.webkitRelativePath || file.name)));
 
         var formData = new FormData();
         formData.append('file', file);