Unfortunately, it seems that the example server code in the readme for the getInitialCwd and getRoot functions seems switched around.
The documentation shows:
getInitialCwd: function(user, callback) {
var userPath = process.cwd() + '/' + user;
fs.exists(userPath, function(exists) {
exists ? callback(null, userPath) : callback('path does not exist', userPath);
});
},
getRoot: function(user) {
return '/';
}
Where that code doesn't work and it should be something like
getRoot: function(connection, callback) {
callback(null, '/absolute/upload/path');
},
getInitialCwd: function() {
return '/';
}
Using the functions the documentation provides like that provides an unsable/unsecure FTP server instance (the user can browse any directory);
Unfortunately, it seems that the example server code in the readme for the getInitialCwd and getRoot functions seems switched around.
The documentation shows:
Where that code doesn't work and it should be something like
Using the functions the documentation provides like that provides an unsable/unsecure FTP server instance (the user can browse any directory);