node.js - node js : ftp multiple files -
i files (json , txt files) remote machine show details on web page after loggin in. recreated intermediate page ftp file , on successful response show next page.
i use https://www.npmjs.com/package/ftp package ftp file. can 1 file 1 connection. function there mget function?
like multiple files different file names , extensions
sample code
var client = require('ftp'); var fs = require('fs'); var c = new client(); c.on('ready', function() { c.get('foo.txt', function(err, stream) { if (err) throw err; stream.once('close', function() { c.end(); }); stream.pipe(fs.createwritestream('foo.local-copy.txt')); }); }); // connect localhost:21 anonymous c.connect();
Comments
Post a Comment