-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_con.js
More file actions
39 lines (33 loc) · 812 Bytes
/
test_con.js
File metadata and controls
39 lines (33 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
This script is used to test connection to ftp server.
*/
var _config = require('./config');
var fs = require('fs');
var Client = require('ftp');
var ftpConfig = {
'host' : _config.ftpServer,
'port' : _config.ftpPort,
'user' : _config.ftpUser,
'password' : _config.ftpPass
};
var c = new Client();
//TEST CONNECTION
// c.on('ready', function() {
// c.list(function(err, list) {
// if (err) console.log(err);
// list.forEach(function(file) {
// console.log(file.name);
// });
// c.end();
// });
// });
//TEST UPLOAD SOME FILE
c.on('ready', function() {
c.put('dummy.txt', 'dummy.txt', function(err) {
if (err) throw err;
console.log('uping');
c.end();
});
});
c.connect(ftpConfig);
console.log('...................... end of file');