That was the problem. It was only a 5KB file that transferred fast. Once I sent a larger file, the progress did show fractions. Thanks.
- JR_Baas
Option Compare Database
Option Explicit
Private WithEvents MySession As WinSCPnet.Session
Private Sub MySession_FileTransferProgress(ByVal sender, ByVal e As WinSCPnet.FileTransferProgressEventArgs)
Dim progress As Double
progress = e.FileProgress * 100#
Debug.Print progress, e.CPS
End Sub
Public Sub OpenConnection(Protocol As WinSCPnet.Protocol, HostName As String, UserName As String, Password As String, SshHostKeyFingerprint As String)
Set MySession = New WinSCPnet.Session
Dim MySessionOptions As New WinSCPnet.SessionOptions
With MySessionOptions
.Protocol = Protocol
.HostName = HostName
.UserName = UserName
.Password = Password
.SshHostKeyFingerprint = SshHostKeyFingerprint
End With
MySession.Open MySessionOptions
End Sub
Public Sub UploadFile(LocalFileName As String, RemoteFileName As String)
Dim MyTransferOptions As New WinSCPnet.TransferOptions
Dim MyTransferResult As WinSCPnet.TransferOperationResult
MyTransferOptions.TransferMode = TransferMode_Binary
Set MyTransferResult = MySession.PutFiles(LocalFileName, RemoteFileName, False, MyTransferOptions)
MyTransferResult.Check
End Sub
Public Sub CloseConnection()
MySession.Dispose
End Sub
Dim sftp As New clsWinSCP
sftp.OpenConnection Protocol_Sftp, RemoteServer(2), RemoteUser(2), RemotePassword(2), "ssh-rsa 1024 c69mpwnBX+y3BE0t5zywJHyJOtx/xwzb+JmFHwTPIig="
sftp.UploadFile LocalFilePath & "\" & fileName$, RemoteFilePath(2)
sftp.CloseConnection
0 0
0 0
100 0
100 0
100 0
100 0