Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PBug90 opened this issue Jan 22, 2019 · 0 comments

Comments

@PBug90
Copy link

PBug90 commented Jan 22, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant