Skip to content

documentation - clarify put behaviour if input is a string and file does not exist #10

Description

@PBug90

Documentation currently states the following:

put(< mixed >input, < string >destPath, [< boolean >useCompression, ]< function >callback) - (void) - Sends data to the server to be stored as destPath. input can be a ReadableStream, a Buffer, or a path to a local file. useCompression defaults to false. callback has 1 parameter: < Error >err.

If the input argument is of type string, the function checks if that string is a path to an existing file by using fs.stat. If that file does not exist, the string itself will be transferred to the remote server and saved as a file containing the string in destPath.

For me this behaviour was unclear given the above description of the put operation and I had to take a look at the actual implementation here: https://github.com/icetee/node-ftp/blob/master/lib/connection.js#L1068

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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