When receiving files with the ReceiveFile method, some FTP servers will not provide the library with the size of the file currently 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.
If you require these particular statistics, you can perform the following workaround in order to make sure you get them:
Use the ReceiveMultipleFiles method instead of the ReceiveFile method. The ReceiveMultipleFiles method requests a complete listing from the FTP server before downloading any files. The library therefore obtains the file sizes of each file being downloaded and can then provide these statistics during the FileTransferStatus event. If you use this technique, keep in mind that the receive operation is slightly slower (due to the extra listing operation) and that the only way to specify the local filename (if you want to rename the incoming file) is to modify the sLocalFilename parameter of the ReceivingFile event.
Imported from legacy forums. Posted by Xceed admin (had 661 views)