|
|
|
@ -73,7 +73,7 @@ class ServerUnit extends Unit {
|
|
|
|
|
const placeholder = socket.session.temp_write_files?.[node.uuid] || await tmp.file()
|
|
|
|
|
socket.session.temp_write_files[node.uuid] = placeholder
|
|
|
|
|
|
|
|
|
|
console.log('Upload placeholder!', placeholder)
|
|
|
|
|
console.log('Upload placeholder:', placeholder)
|
|
|
|
|
|
|
|
|
|
const old_file = await node.uploaded_file()
|
|
|
|
|
if ( old_file ) {
|
|
|
|
@ -89,7 +89,7 @@ class ServerUnit extends Unit {
|
|
|
|
|
console.log('write stream', stream)
|
|
|
|
|
console.log('write data', { placeholder, position, length })
|
|
|
|
|
|
|
|
|
|
stream.pipe(fs.createWriteStream(placeholder.path, { start: position }))
|
|
|
|
|
stream.pipe(fs.createWriteStream(placeholder.path, { flags: 'r+', start: position }))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_bufferStream(stream) {
|
|
|
|
|