0 votes
by (220 points)

this is my c# code:

sftp.Upload("C:\xxx", "/root/xxx");

this code throw exception "Could not find target directory" but i'm sure this Ubuntu has this directory. How can i solve this problem ? Where i am looking for?

Applies to: Rebex SFTP

1 Answer

0 votes
by (58.9k points)


I do not know what is 'xxx' is this the filename?
If xxx is a file name, you will need this code to upload it:

sftp.Upload(@"C:\filename.txt", "/root/");

or even simpler method (if you only upload single file):

sftp.PutFile(@"C:\filename.txt", "/root/file.txt");

Does it help?