The put ends with no error but when I am checking the size on the ftp the file is not fully uploaded.
The logic is a little random, with the script I just set earlier it will upload between 80% and 100%, but this was just a script to debug.
The normal script is doing heavy processing on the bin file generation and in this case the upload is between 5% and 10%
I tried to add a function to cut my buffer
/**
*
* @param {Buffer} buffer
* @param {number} splitSize
*/
module.exports.splitBuffer = (buffer, splitSize) => {
let i = 0;
const bufferSize = buffer.byteLength;
const buffers = [];
while(i < bufferSize) {
const start = i;
const end = i + splitSize > bufferSize ? bufferSize : i + splitSize;
buffers.push(buffer.slice(start, end));
i = end;
}
return buffers
}
and then upload it using put for the first element and then append but my ftp server does not support append
Hi,
I am trying to upload a file of 116MB into a local ftp server.
The put ends with no error but when I am checking the size on the ftp the file is not fully uploaded.
The logic is a little random, with the script I just set earlier it will upload between 80% and 100%, but this was just a script to debug. The normal script is doing heavy processing on the bin file generation and in this case the upload is between 5% and 10%
I tried to add a function to cut my buffer
and then upload it using
put
for the first element and thenappend
but my ftp server does not supportappend