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")
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) {
});
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