You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current behavior of the Upload(FileInfo fileInfo, string path) method is not deterministic. The path to which the content is uploaded depends on whether a directory exists for the specified (remote) path.
Path does not exist as directory
When no directory exists for the (remote) path that is specified in Upload(FileInfo fileInfo, string path), then the file is - as expected - uploaded to the path in question.
Example
Local path: c:\source\somefile.txt Remote path: /home/sshnet/file Result: content of c:\source\somefile.txt is uploaded to /home/sshnet/file.
Path exists as directory
However, if a directory exists for the specified path then the content is uploaded to '<(remote) path>/<fileInfo.Name>'.
Example
Local path: c:\source\somefile.txt Remote path: /home/sshnet/file Result: Content of c:\source\somefile.txt is uploaded to /home/sshnet/file/somefile.txt.
Proposal
Instead of having this non-deterministic behavior, we should have the SCP server reject the upload if a directory exists for the specified (remote) file path.
The text was updated successfully, but these errors were encountered:
…ng a file, and use zero-length pass in C directive. Combined, this ensure the SCP server will reject a remote file path that points to a directory.
Fixes issue #286.
…ng a file, and use zero-length pass in C directive. Combined, this ensure the SCP server will reject a remote file path that points to a directory.
Fixes issue #286.
The current behavior of the
Upload(FileInfo fileInfo, string path)
method is not deterministic. The path to which the content is uploaded depends on whether a directory exists for the specified (remote) path.Path does not exist as directory
When no directory exists for the (remote) path that is specified in
Upload(FileInfo fileInfo, string path)
, then the file is - as expected - uploaded to the path in question.Example
Local path: c:\source\somefile.txt
Remote path: /home/sshnet/file
Result: content of c:\source\somefile.txt is uploaded to /home/sshnet/file.
Path exists as directory
However, if a directory exists for the specified path then the content is uploaded to '<(remote) path>/<fileInfo.Name>'.
Example
Local path: c:\source\somefile.txt
Remote path: /home/sshnet/file
Result: Content of c:\source\somefile.txt is uploaded to /home/sshnet/file/somefile.txt.
Proposal
Instead of having this non-deterministic behavior, we should have the SCP server reject the upload if a directory exists for the specified (remote) file path.
The text was updated successfully, but these errors were encountered: