I have dynamic data to be uploaded with custom file name. I would like to create a binary buffer, create a file and load the buffer into the file and then sftp the file.
Please see the following code which uploads a custom file.
let chargesString = 'CHARGES';
let chargesFileName = 'charges.txt';
let buffer = new Buffer(chargesString, 'binary');
Ftp.put(buffer, chargesFileName, function(hadError) {
console.log('Entering');
if (!hadError){
console.log("Charges File transferred successfully!");
} else {
console.error('There was an error uploading the Charges file.', hadError);
}
});
The above code is feasible with ftp which doesnt do sftp.
Is this possible here? If not can you please add that feature.
I have dynamic data to be uploaded with custom file name. I would like to create a binary buffer, create a file and load the buffer into the file and then sftp the file.
Please see the following code which uploads a custom file.
let chargesString = 'CHARGES'; let chargesFileName = 'charges.txt'; let buffer = new Buffer(chargesString, 'binary'); Ftp.put(buffer, chargesFileName, function(hadError) { console.log('Entering'); if (!hadError){ console.log("Charges File transferred successfully!"); } else { console.error('There was an error uploading the Charges file.', hadError); } }); The above code is feasible with ftp which doesnt do sftp.
Is this possible here? If not can you please add that feature.