mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 243 forks source link

Ready And Greeting Event not triggered while connecting #269

Open adishupadhyay opened 4 years ago

adishupadhyay commented 4 years ago

Hi All,

While connecting to FTP server ready and greeting event did not trigger. after few second end and close event is called below is my code var mime = require('mime-types') var Client = require('ftp'); var fs = require('fs') var ftpClient = new Client(); ftpClient.on('greeting', function (msg) { console.log("****FTP connected*") }); ftpClient.on('ready', function () { console.log("****FTP connected*") }); ftpClient.on('close', function (hadErr) {

console.log("******FTP Connection has been closed", hadErr)

});

ftpClient.on('error', function (error) { console.log("****Error in connecting to FTP", error)

}); ftpClient.on('end', function () { console.log("****Connection has been ended")

}); ftpClient.connect({ "host": 'hostname', "port": 22, "user": "user", "password": "password", "keepalive": 500, // "pasvTimeout": 50000, "connTimeout": 5500000 }); Plz help