Click here to Skip to main content
16,016,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All
pl help me SFTP Using file uplaod and download in c#.net
sample coding send

regards ,
E.Veeraperumal
Posted
Updated 26-Dec-17 17:27pm
Comments
I guess you have rejected my answer after accepting it by mistake. If that is the case, please accept the answer again.

Thanks,
Tadit

If using a 3rd-party is an option, you can try this sftp library for .net c# & vb. Here is an example code of how to upload files:

C#
// Create a new class instance.
Sftp client = new Sftp();

// Connect to the SFTP server.
client.Connect("localhost");

// Authenticate.
client.Authenticate("test", "test");

// ... 
 
// Upload all files and subdirectories from local folder 'c:\temp' to the remote dir '/temp'
client.Upload("c:\\temp", "/temp");

// Upload all directories, subdirectories, and files that match the specified search pattern from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.Upload("c:\\myfolder2", "/myfolder2", "*.cs");

// or you can simply put wildcard masks in the source path, our component will automatically parse it. 
// upload all *.css files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.Upload("c:\\myfolder2\\*.css", "/myfolder2");

// Upload *.cs and *.vb files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.Upload("c:\\myfolder2\\*.cs;*.vb", "/myfolder2");

// ... 
 
// Disconnect.
client.Disconnect();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900