-
Notifications
You must be signed in to change notification settings - Fork 606
Open
Description
Given the following code:
SCPFileTransfer xfer = client.newSCPFileTransfer();
String path = "C:\\tmp\\File1.txt";
xfer.download(path, path); // WORKS
xfer.upload(path, path); // ERROR
The download succeeds, but the upload gives the error:
Remote SCP command had error: scp: 'C:/tmp/File1.txt': No such file or directory
I tried:
- Stepping through the code and waiting a bit after the download, just to be sure it didn't still have the file open.
- Commenting out the download and just doing the upload.
- Deleting the file on the remote server just to make sure it wasn't an overwrite issue or anything.
- Using different file names for the local and remote - it's definitely the 2nd parameter of uploadFile (remotePath) that is throwing the error.
- Just specifying a path, not a filename for the remotePath
Not really sure how that could be the case. Clearly it's a valid path, because it was used for the download, which succeeded.
May be worthy of note: Both machines are Windows.
Machine at remote end is Windows 2025 running the stock MS OpenSSH server.
Metadata
Metadata
Assignees
Labels
No labels