jsftp
jsftp copied to clipboard
.rename 501 Bad sequence of commands fix
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.