mscdex / node-ftp

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

.append doesn't append to file (it overwrites it) #250

Open nagman opened 5 years ago

nagman commented 5 years ago

Hi,

I'm trying to add lines to a distant file on an FTP server, but the append method doesn't seem to append my string to the file.

My code:

const c = new ClientFTP();
c.connect({
  host: ...,
  user: ...,
  password: ...,
});
c.on('ready', function() {
  c.append('foo bar bar foo foo bar foo', 'file.txt', function(err) {
    if (err) throw err;
    c.end();
  });
});
sp00x commented 4 years ago

Just on the odd chance that the server on the other end is filezilla ftpd, I noticed this comment in a project using this module:

// for some reason filezilla ftp server does not like order REST PASV STOR, but needs PASV REST STOR or else it overwrites the file instead of resuming it ??!

Not that this helps, but...