Downloading files/directories using Ultimate FTP

FTP is the abbreviation of File Transfer Protocol which is used to transfer file from one server to another. Using the Ultimate .NET FTP Library, you can download a single file or multiple remote files. Today we will go through all the steps to guide you on how to achieve that.

FTP Download File

The file transfer protocol has a lot of command line options to manage remote items. However, here, we will discuss how you can use Ultimate FTP in your application to perform these operations.

When performing download/upload to FTP, network bandwidth is of utmost importance. Ultimate FTP offers a way to control bandwidth that restricts the amount of data transferred per second. In a shared network, when bandwidth usage for consumers is essential, the throttling feature let you adjust transfer speed on the fly to control the network bandwidth usage for each. Another case that the feature is useful is when stability is increased when we decrease the transfer speed.

Downloading a single file

Ultimate FTP allows you to download the remote file to either local disk or memory.

Downloading a remote file to a local file

First, you need to add necessary references to Ultimate FTP, and import appropriate namespaces.

C#:

using ComponentPro;
using ComponentPro.IO;
using ComponentPro.Net;

VB.NET

Imports ComponentPro
Imports ComponentPro.IO
Imports ComponentPro.Net

The following code downloads the file from templates folder on the server, using FTP protocol, and saves it to local disk:

C#:

// Create a new class instance.
Ftp client = new Ftp();
// Connect to the FTP server.
client.Connect("localhost");
// Authenticate.
client.Authenticate("user", "password");
// ... 
 
// Download remote file "templates\mytemplate.txt" to "c:\mytemplate.txt"
client.DownloadFile(@"templates\mytemplate.txt", @"c:\mytemplate.txt
");
// ... 
 
// Disconnect.
client.Disconnect();

VB.NET

' Create a new class instance. 
Dim client As New Ftp()
' Connect to the FTP server.
client.Connect("localhost")
' Authenticate.
client.Authenticate("user", "password")
' ... 
 
' Download remote file 'templates\mytemplate.txt' to 'c:\
mytemplate.txt'
client.DownloadFile("templates\mytemplate.txt", "c:\ mytemplate.txt")
' ... 
 
' Disconnect.
client.Disconnect()

45-Day Money Back Guarantee

We will refund your full money in 45 days
if you are not satisfied with our products

Buy Now

Dont miss out Get update on new articles and other opportunities