0 votes
by (120 points)
edited

Hello,

I have a VB.Net Windows app that is transferring 1 file using Rebex.Net.SFTP.

It works fine, but I need to know the status of the transfer so I can create my own log file.

How do I get the transfer status telling it the transfer had a problem or completed successfully?

MANY thanks

Applies to: Rebex SFTP

1 Answer

+1 vote
by (70.2k points)
edited

Hello Carl,

status of the currently transferring file is reported by TransferProgress event. How to register it shows following sample code.

Dim client As New Sftp

AddHandler client.TransferProgress, AddressOf client_TransferProgress
client.GetFile("remotePath", "localPath")

Public Sub client_TransferProgress(ByVal sender As Object, _
    ByVal e As SftpTransferProgressEventArgs)
End Sub

You can also check out the ResumableTransfer sample where the TransferProgress event is used.

When the transfer is completed TransferProgress event is fired and Finished property (of the SftpTransferProgressEventArgs) is set to true.

However, if any problem occurs during the transfer exception is thrown (no event with failed status is faired).

...