atinux / node-ftps

FTP, FTPS and SFTP client for node.js, mainly a lftp wrapper.
MIT License
202 stars 57 forks source link

Please help this beginner, Simple Testing. #74

Closed oniej closed 3 years ago

oniej commented 5 years ago

I'm totally new on using this component and don't know what left and right here.

I tried using the demo code like this:

const os = require('os');

const output = [];

const data = [ { state: 'Maryland', capital: 'Annapolis', population: 38394 }, { state: 'New York', capital: 'Albany', population: 97856 }, ];

data.forEach((d) => {

output.push( d.state + "\t" + d.capital + "\t" + d.population + "\n"); });

var fileName = 'FILE_SAMPLE.tsv';

var dataTVS = output.join(os.EOL);

var FTPS = require('ftps'); var ftps = new FTPS({ host: server, username: username, password: password, protocol: 'ftps', port: 21, escape: true, retries: 2, timeout: 10, retryInterval: 5, retryMultiplier: 1, requiresPassword: true });

ftps.put(dataTVS, fileName)

and when I run this program, there's no error but the file that I generate is also not found. I really think that there's something that's missing, and I don't know what it is. Please someone help...

LorenzoScarpa commented 4 years ago

ftps.put(dataTVS, fileName).exec(callback)