How to upload selected files and directories
Use the UploadFiles method to easily upload selected files and directories from the local disk to the FTP server. You just need to provide local path, remote path, files and directories to upload and transfer options, ATP Ultimate FTP component will do the rest of hard work for you.
The following steps show you how to use the UploadFiles method to upload multiple files to the remote server. To download multiple files, see this http://www.ftpcomponent.net/downloading-multiple-files-and-directories
C#
// Create a new instance.
Ftp client = new Ftp();
// Connect to the FTP server.
client.Connect("localhost");
// Authenticate.
client.Authenticate("test", "test");
// ...
// List of files and directories to upload.
string[] files = new string[] { "myfile", "my dir", @"c:\my folder\my dir2" };
// Upload selected files and subdirectories in local folder 'c:\my folder' to the remote dir '/temp'.
client.UploadFiles(@"c:\my folder", files, "/temp", new TransferOptions());
// ...
// Disconnect.
client.Disconnect();
VB.NET
' Create a new instance.
Dim client As New Ftp()
' Connect to the FTP server.
client.Connect("localhost")
' Authenticate.
client.Authenticate("test", "test")
' ...
' List of files and directories to upload.
Dim files() As String = {"myfile", "my dir", "c:\my folder\my dir2"}
' Upload selected files and subdirectories in local folder 'c:\my folder' to the remote dir '/temp'.
client.UploadFiles("c:\my folder", files, "/temp", New TransferOptions())
' ...
' Disconnect.
client.Disconnect()
Click here to download the Ultimate FTP Component for .NET, or here to download the .NET CF version.