wodFTPServer ActiveX Control - Progress64 Event
    
 

Description

Fires during file transfer for large files.


Syntax

Private Sub object_Progress64(User, PositionLo, PositionHi, TotalLo, TotalHi)



The Progress64 Event syntax has these parts:

Part Description
object A wodFTPD object.
User A FtpUser object. Reference to user who is transferring file.
PositionLo A Long value. Low double word of current position of file transfer.
PositionHi A Long value. High double word of current position of file transfer.
TotalLo A Long value. Low double word of total size of file that will be transferred, if known.
TotalHi A Long value. High double word of total size of file that will be transferred, if known.

Remarks

Progress64 event is fired during file upload or download. You can track and calculate client's speed using this property.

If user is uploading file, its size is not known before upload is completed - thus Total and Position arguments will always contain same value - total number of bytes uploaded so far.

Progress64 event will be fired only after file size exceeds 4.2gb. Before this size limit, Progress event will be fired instead.

NOTE: it is possible that Position or Total values become negative - it is because unsigned values are used, but VB (and other environments) expect to see signed values. If this happens, we suggest you use following code (VB example):

Private Const MAX_UNSIGNED = 4294967296#
 
Private Sub FtpD_Progress(ByVal User As wodFTPDComLib.IFtpUser, ByVal Position As Long, ByVal Total As Long)
    FtpD_Progress64 User, Position, 0, Total, 0
End Sub

Private Sub FtpD_Progress64(ByVal User As wodFTPDComLib.IFtpUser, ByVal PositionLo As Long, ByVal PositionHi As Long, ByVal TotalLo As Long, ByVal TotalHi As Long)
    If TotalLo <> 0 Then
        Dim pos As Double
        Dim tot As Double

        pos = PositionLo
        If (pos < 0) Then pos = pos + MAX_UNSIGNED
        tot = TotalLo
        If tot < 0 Then tot = tot + MAX_UNSIGNED

        If TotalHi <> 0 Then
            pos = pos + PositionHi * (MAX_UNSIGNED + 1)
            tot = tot + TotalHi * (MAX_UNSIGNED + 1)
        End If

        Debug.Print "Progress " & pos & "/" & tot
    Else
        Debug.Print "Progress " & PositionLo & "/" & TotalLo
    End If
End Sub