Skip to content

Readme Example getInitialCwd and getRoot #48

@ahornerr

Description

@ahornerr

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions