node-ftps icon indicating copy to clipboard operation
node-ftps copied to clipboard

Can I create a file over the fly ?

Open omkartin opened this issue 8 years ago • 0 comments

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.

omkartin avatar Aug 15 '17 14:08 omkartin