Share via


Connect to a FTP using SFTP

Question

Monday, July 29, 2019 7:16 AM

Hi guys, I am new to C# and visual Studio. I need to connect to a 'FTP' using 'SFTP'. I want my program to have the posibility to upload and download files from this FTP server.

Note: Im using VS 2017 by the way

All replies (3)

Monday, July 29, 2019 8:54 AM âś…Answered | 1 vote

Hi 

Thank you for posting here.

Based on your description, you want to upload and download files from ftp server.

You could look at the first reply in the following link.

https://stackoverflow.com/questions/10657377/achieving-ftp-sftp-without-3rd-party-dll-with-ftpwebrequest-if-possible-in-c-sha

Best Regards,

Jack

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Monday, July 29, 2019 8:51 AM

You should check the WinSCP nuget package at (https://www.nuget.org/packages/WinSCP/). You can find examples at the Project site (link found on the nuget package page)


Monday, July 29, 2019 11:58 AM

You can check-out this thread

http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/22f6c8f1-0376-40ec-bbf9-c4f9835e1b97/

SFTP and FTP are different protocols and libraries to use are different either. FTPS can be achieved using FtpWebRequest class in .NET Framework. However, there's no need to know the difference and you can still connect to both servers using the same code and transfer files and directories from one server to the other regardless of server type FTP or SFTP. Check out these blogposts: http://www.sftpcomponent.net/using-ultimate-ftp-sftp-libraries-to-transfer and http://www.sftpcomponent.net/using-iremotefilesystem-to-work-with-both-sft