Home Forums ActiveX components Xceed FTP for ActiveX Some of the parameters of the FileTransferStatus event are not being updated when calling the ReceiveFile method. Why?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #42843 |

    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)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.