@@ -66,8 +66,7 @@ export default function init(): Router {
66
66
}
67
67
68
68
try {
69
- const uploadDir = join ( HOME , dest_dir ) ;
70
-
69
+ const uploadDir = join ( HOME , ".smc" , "upload" ) ;
71
70
// ensure target path exists
72
71
dbg ( "ensure target path exists... " , uploadDir ) ;
73
72
await mkdir ( uploadDir , { recursive : true } ) ;
@@ -113,7 +112,7 @@ export default function init(): Router {
113
112
}
114
113
*/
115
114
116
- // Now, the strategy is to assemble to file chunk by chunk and save it with the original filename
115
+ // Now, the strategy is to assemble the file chunk by chunk and save it with the original filename
117
116
const chunkFullPath = files . file [ 0 ] ?. filepath ;
118
117
const originalFn = files . file [ 0 ] ?. originalFilename ;
119
118
@@ -124,6 +123,7 @@ export default function init(): Router {
124
123
dbg ( `uploading '${ chunkFullPath } ' -> '${ originalFn } '` ) ;
125
124
}
126
125
126
+ const temp = join ( uploadDir , originalFn ) ;
127
127
const dest = join ( HOME , dest_dir , originalFn ) ;
128
128
dbg ( `dest='${ dest } '` ) ;
129
129
await ensureContainingDirectoryExists ( dest ) ;
@@ -133,6 +133,7 @@ export default function init(): Router {
133
133
parseInt ( fields . dzchunkindex ) ,
134
134
parseInt ( fields . dztotalchunkcount ) ,
135
135
chunkFullPath ,
136
+ temp ,
136
137
dest ,
137
138
dest_dir ,
138
139
compute_server_id ,
@@ -159,11 +160,11 @@ async function handle_chunk_data(
159
160
index : number ,
160
161
total : number ,
161
162
chunk : string ,
163
+ temp : string ,
162
164
dest : string ,
163
165
dest_dir : string ,
164
166
compute_server_id : number ,
165
167
) : Promise < void > {
166
- const temp = dest + ".partial-upload" ;
167
168
if ( index === 0 ) {
168
169
// move chunk to the temp file
169
170
await moveFile ( chunk , temp ) ;
0 commit comments