Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the Event? #13

Open
kingeaglewang opened this issue Jun 22, 2018 · 2 comments
Open

How to use the Event? #13

kingeaglewang opened this issue Jun 22, 2018 · 2 comments

Comments

@kingeaglewang
Copy link

I have the following code:

`
var EasyFtp = require('easy-ftp')

var ftp = new EasyFtp()

var config = {
host:'',
port: 21,
username: '
',
password: '
********',
type: 'ftp'
}

ftp.on("open", function(client){
console.log('open')
})

ftp.connect(config)

ftp.close(); `

But why there is no 'open' string showing in console ?

Any suggestion for helping me ?

Thanks

@humy2833
Copy link
Owner

I think you should disconnect after the connection is complete.

ftp.on("open", function(client){
console.log('open');
ftp.close();
});
ftp.connect(config);

@kingeaglewang
Copy link
Author

Thanks. It works.
By the way, can I know the progress of download or upload ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants