The FileTransferStatus event is triggered for every packet sent or received during a file transfer. It returns progress information and statistics on single-file, or multiple-file send or receive operations.
For operations that only transfer one file, such as when calling the ReceiveFile, ReceiveMemoryFile, SendFile or SendMemoryFile methods, the parameters starting with "Total" are redundant. For operations that transfer multiple files, such as SendMultipleFiles and ReceiveMultipleFiles, the parameters starting with "Total" are statistics that concern the entire group of files being sent or received, while the other parameters only provide information on the current file being sent or received at the time the event is triggered.
When receiving files with the ReceiveFile method, some FTP servers will not provide the library with the file size of the file currently file being received. This happens especially when the PassiveMode Property is set to True. When this happens, some FileTransferStatus event parameters (such as lFileSize and nBytesPercent) will always contain the value 0. Read the File size workarounds topic to find out how to solve this problem.
None of the parameters can be modified.
Parameter | Description |
---|---|
sLocalFilename | The local filename of the file being transferred. |
sRemoteFilename | The remote filename of the file being transferred. |
lFileSize | The size of the file being sent, or the size reported by the FTP server of the file being received. |
lBytesTransferred | The amount of bytes transferred for the current file. |
nBytesPercent | The percentage of bytes transferred for the current file. |
lTotalSize | The total amount of bytes of all files that will be transferred. Can be 0 if the size is not available. |
lTotalBytesTransferred | The total amount of bytes transferred so far for the group of files to be transferred. |
nTotalBytesPercent | The percentage of the bytes that have been transferred for the entire group of files to transfer. |
lTotalFiles | The total number of files to transfer. |
lTotalFilesTransferred | The total number of files transferred so far. |
nTotalFilesPercent | The percentage of files that have been transferred so far. |
lBytesPerSecond | The current file's average throughput in bytes per second. |
lTotalBytesPerSecond | The average throughput for the entire group of files being sent, in bytes per second. |
Declaration (event) | |
---|---|
|
Declaration (interface implementation) | |
---|---|
|