jsftp icon indicating copy to clipboard operation
jsftp copied to clipboard

.rename 501 Bad sequence of commands fix

Open frylo0 opened this issue 3 years ago • 0 comments

I've already found solution.

Ftp.prototype.rename = function(from, to, callback) {
  this.raw("rnfr", from, err => {
    if (err) {
      return callback(err);
    }
    this.raw("rnto", to, callback);
  });
};

Here, functions in lower case. Changing to upper case fixed problems.

Ftp.prototype.rename = function(from, to, callback) {
  this.raw("RNFR", from, err => {
    if (err) {
      return callback(err);
    }
    this.raw("RNTO", to, callback);
  });
};

Error before fix: 501 Bad sequence of commands This solutiuons works for me.

frylo0 avatar Aug 23 '22 17:08 frylo0