-
-
Notifications
You must be signed in to change notification settings - Fork 946
UploadDirectory in ScpClient.Net #81
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
Comments
I did some tests myself, and I don't see any issues. I created the following local directory structure:
I created the following remote directory:
I then used the following code to perform the upload: using (var client = new ScpClient(connectionInfoFactory.Create()))
{
client.Connect();
client.Upload(new DirectoryInfo(@"c:\temp\foo"), "/home/sshnet/test");
} I ended up with the following remote result:
Please share more about your local directory structure, the code you used to upload and the remote result. |
Not sure why I couldn't reproduce this issue before, but this week I stumbled onto this issue myself. This should be fixed in version 2016.1.0-beta1. |
I'll try to test it today, sorry for the delay, but was hectic here at work the past months. |
It works, I had to change my function call because in the past i used something like: UploadDirectory("c:\temp\configurationfiles", "/etc") and then expect it the folder to be created on the target, while the functionality actually is that it will copy the content of the directory instead of the directory . |
Fixed by issue #128. |
I was testing the uploading of whole directories with ScpClient using the Upload(DirectoryInfo directoryInfo, string Path) function (ScpClient.NET.cs)
My example uploads c:\temp\configuration to /home/root
I was expecting to get the content of my local folder in /home/root/configuration
but it ended up in /home/root/root
What I think is the faulty line is
SendData(channel, string.Format("D0755 0 {0}\n", Path.GetFileName(path)));
I believe it should be:
SendData(channel, string.Format("D0755 0 {0}\n", directoryInfo.Name));
The text was updated successfully, but these errors were encountered: