SFTP Transfer Status

0 votes
asked Jan 29, 2010 by Carl (120 points)
edited Mar 2, 2010

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
answered Jan 29, 2010 by Lukas Matyska (55,430 points)
edited Jan 29, 2010

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).

...