jsftp icon indicating copy to clipboard operation
jsftp copied to clipboard

Can Ftp.get be copied to a buffer rather than to file ?

Open omkartin opened this issue 8 years ago • 1 comments

Hello Sergi,

Can we copy the file contents from remote (Ftp.get) into a buffer rather than a file ??

I tried this piece of code. This doesn't work.

var str = ""; // Will store the contents of the file ftp.get('remote/path/file.txt', function(err, socket) { if (err) return; socket.on("data", function(d) { str += d.toString(); }) socket.on("close", function(hadErr) { if (hadErr) console.error('There was an error retrieving the file.'); }); socket.resume(); });

Please help!

omkartin avatar Jul 18 '17 14:07 omkartin

Running into the same problem 🙃

jdalrymple avatar Jul 05 '18 19:07 jdalrymple