wodFTPServer ActiveX Control - Progress64 Method
      
 

Description

Called during file transfer for large files.


Return Type

None  


Syntax

object.Progress64 Owner, User, PositionLo, PositionHi, TotalLo, TotalHi



The Progress64 Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodFTPDNotify.
Owner A wodFTPDCom object. Reference to wodFTPServer instance that called this notification method.
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

NOTE: This method is called only if you implemented IwodFTPDNotify interface in your application, and wodFTPD.Notification property has received reference to instance of your implementation.

Progress64 notification method 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 notification method will be called only after file size exceeds 4.2gb. Before this size limit, Progress notification method will be called 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 IwodFTPDNotify_Progress(ByVal Owner As wodFTPDComLib.IwodFTPDCom, ByVal User As wodFTPDComLib.IFtpUser, ByVal Position As Long, ByVal Total As Long)
    IwodFTPDNotify_Progress64 User, Position, 0, Total, 0
End Sub

Private Sub IwodFTPDNotify_Progress64(ByVal Owner As wodFTPDComLib.IwodFTPDCom, 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