Monitoring FTP Transfer Progress


The Ftp component provides built-in support for tracking the progress of file transfers through the StartTransfer, Transfer, and EndTransfer events.

These events notify when a transfer starts, report ongoing progress, and indicate completion for both uploads and downloads. Here is a basic example:

Ftp client = new Ftp();
string currentFile = "C:/path/to/my.file";

client.OnStartTransfer += (obj, ev) =>
{
  Console.WriteLine("Start: " + currentFile);
};

client.OnTransfer += (obj, ev) =>
{
  Console.WriteLine(ev.PercentDone + "% done");
};

client.OnEndTransfer += (obj, ev) =>
{
  Console.WriteLine("End: " + currentFile);
};

client.RemoteFile = currentFile;
client.Download();

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.