Answered by:
Secure FTP Upload and Download

Question
-
Hi,
How to upload files through secure ftp using C# or VB.net.Please provide any dll or class file.
Regards,
Jayagopal
Thursday, June 3, 2010 7:29 AM
Answers
-
When talking about "secure ftp" please clarify whether you mean SFTP or FTPS. These are two different protocols as described in this article .
In any case, SecureBlackbox offers the most feature-rich components for both FTPS and SFTP for .NET.
- Marked as answer by Jayagopal Wednesday, June 23, 2010 10:48 AM
Thursday, June 3, 2010 9:17 AM
All replies
-
When talking about "secure ftp" please clarify whether you mean SFTP or FTPS. These are two different protocols as described in this article .
In any case, SecureBlackbox offers the most feature-rich components for both FTPS and SFTP for .NET.
- Marked as answer by Jayagopal Wednesday, June 23, 2010 10:48 AM
Thursday, June 3, 2010 9:17 AM -
FTPS is supported by the .NET Classes. To use this set the EnableSSL property as outlined in this documentation. http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.enablessl.aspx
- Proposed as answer by Jeff SandersMicrosoft employee Thursday, June 10, 2010 1:06 PM
Thursday, June 3, 2010 12:00 PM -
Secure FTP may can stand for either SSH SFTP or FTP/SSL. THe following examples show you how to upload files with both protocols using Ultimate SFTP and Ultimate FTP libs
SSH SFTP:
// Create a new 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.UploadFiles("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.UploadFiles("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.UploadFiles("c:\\myfolder2\\*.css", "/myfolder2");
// Upload *.cs and *.vb files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.UploadFiles("c:\\myfolder2\\*.cs;*.vb", "/myfolder2");
// ...
// Disconnect.
client.Disconnect();
FTP/SSL:
// Create a new instance.
Ftp client = new Ftp();
// Connect to the FTP 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.UploadFiles("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.UploadFiles("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.UploadFiles("c:\\myfolder2\\*.css", "/myfolder2");
// Upload *.cs and *.vb files from local folder 'c:\myfolder2' to remote folder '/myfolder2'.
client.UploadFiles("c:\\myfolder2\\*.cs;*.vb", "/myfolder2");
// ...
// Disconnect.
client.Disconnect();Friday, October 22, 2010 10:37 PM