Table of Contents

Class FtpProgress

Namespace
FluentFTP
Assembly
FluentFTP.dll

Class to report FTP file transfer progress during upload or download of files

public class FtpProgress
Inheritance
FtpProgress
Inherited Members
Extension Methods

Constructors

FtpProgress(double, long, double, TimeSpan, string, string, FtpProgress)

Create a new FtpProgress object for individual file transfer progress.

public FtpProgress(double progress, long bytesTransferred, double transferspeed, TimeSpan remainingtime, string localPath, string remotePath, FtpProgress metaProgress)

Parameters

progress double
bytesTransferred long
transferspeed double
remainingtime TimeSpan
localPath string
remotePath string
metaProgress FtpProgress

FtpProgress(int, int)

Create a new FtpProgress object for meta progress info.

public FtpProgress(int fileCount, int fileIndex)

Parameters

fileCount int
fileIndex int

Properties

ETA

A value representing the calculated 'Estimated time of arrival'. Used to track the progress of an individual file transfer.

public TimeSpan ETA { get; set; }

Property Value

TimeSpan

FileCount

Stores the total count of the files to be transferred. Only used when transferring multiple files or an entire directory.

public int FileCount { get; set; }

Property Value

int

FileIndex

Stores the index of the file in the listing. Only used when transferring multiple files or an entire directory.

public int FileIndex { get; set; }

Property Value

int

LocalPath

Stores the absolute local path of the current file being transferred.

public string LocalPath { get; set; }

Property Value

string

Progress

A value between 0-100 indicating percentage complete, or -1 for indeterminate. Used to track the progress of an individual file transfer.

public double Progress { get; set; }

Property Value

double

RemotePath

Stores the absolute remote path of the current file being transferred.

public string RemotePath { get; set; }

Property Value

string

TransferSpeed

A value representing the current Transfer Speed in Bytes per seconds. Used to track the progress of an individual file transfer.

public double TransferSpeed { get; set; }

Property Value

double

TransferredBytes

A value indicating how many bytes have been transferred. When unable to calculate percentage, having the partial byte count may help in providing some feedback.

public long TransferredBytes { get; set; }

Property Value

long

Methods

Generate(long, long, long, TimeSpan, string, string, FtpProgress)

Create a new FtpProgress object for a file transfer and calculate the ETA, Percentage and Transfer Speed.

public static FtpProgress Generate(long fileSize, long position, long bytesProcessed, TimeSpan elapsedtime, string localPath, string remotePath, FtpProgress metaProgress)

Parameters

fileSize long
position long
bytesProcessed long
elapsedtime TimeSpan
localPath string
remotePath string
metaProgress FtpProgress

Returns

FtpProgress

TransferSpeedToString()

Convert Transfer Speed (bytes per second) in human readable format

public string TransferSpeedToString()

Returns

string