File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed
Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -96,31 +96,25 @@ export function scanFiles(dt) {
9696 } )
9797}
9898
99- export function handleFiles ( files , path , overwrite = false ) {
99+ export function handleFiles ( files , base , overwrite = false ) {
100100 for ( let i = 0 ; i < files . length ; i ++ ) {
101- let file = files [ i ]
102-
103- let filename = ( file . fullPath !== undefined ) ? file . fullPath : file . name
104- let filenameEncoded = url . encodeRFC5987ValueChars ( filename )
105-
106101 let id = store . state . upload . id
102+ let path = base
103+ let file = files [ i ]
107104
108- let itemPath = path + filenameEncoded
105+ if ( file . fullPath !== undefined ) {
106+ path += url . encodePath ( file . fullPath )
107+ } else {
108+ path += url . encodeRFC5987ValueChars ( file . name )
109+ }
109110
110111 if ( file . isDir ) {
111- itemPath = path
112- let folders = file . fullPath . split ( "/" )
113-
114- for ( let i = 0 ; i < folders . length ; i ++ ) {
115- let folder = folders [ i ]
116- let folderEncoded = encodeURIComponent ( folder )
117- itemPath += folderEncoded + "/"
118- }
112+ path += '/'
119113 }
120114
121115 const item = {
122116 id,
123- path : itemPath ,
117+ path,
124118 file,
125119 overwrite
126120 }
You can’t perform that action at this time.
0 commit comments