Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Client = require('ftp');
- export class FTP {
- username: string;
- password: string;
- host: string;
- port: number;
- c : any;
- constructor(username,password,host,port){
- this.username = username;
- this.password = password;
- this.host = host;
- this.port = port;
- var c = new Client();
- }
- connect(){
- this.c.on('ready', function() {
- this.c.list(function(err, list) {
- if (err) throw err;
- console.dir(list);
- this.c.end();
- });
- });
- // connect to localhost:21 as anonymous
- var connectProps = {
- host: this.host,
- port: this.port,
- user: this.username,
- password: this.password
- }
- this.c.connect(connectProps);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement