mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 246 forks source link

Could not find addresses in XML #194

Open real050280 opened 6 years ago

real050280 commented 6 years ago

How do you guys workaround such issue ?

For some reason, I don't want to create a physical file and use the NodeJS Buffer instead.

  const filename = '/in/remote_file.xml';
  client.on('ready', function() {
      client.put(Buffer.from(xmlData), filename, function(err) {
        if(err)  throw err;
        client.end();
      })
    });

    client.connect({
      host: process.env.FTP_HOST,
      user: process.env.FTP_LOGIN,
      password: process.env.FTP_PASSWORD
    });