EndTransfer Event
Fired when a file finishes transferring.
Syntax
public event OnEndTransferHandler OnEndTransfer; public delegate void OnEndTransferHandler(object sender, OftpserverEndTransferEventArgs e); public class OftpserverEndTransferEventArgs : EventArgs { public string ConnectionId { get; } public int Direction { get; } public string LocalFile { get; } public string VirtualFileName { get; } public string VirtualFileDate { get; } public string Destination { get; } public string Originator { get; } public int ReasonCode { get; } public string ReasonText { get; } public long FileSize { get; } public string FileHash { get; } public bool SendEndResponse { get; set; } }
Public Event OnEndTransfer As OnEndTransferHandler Public Delegate Sub OnEndTransferHandler(sender As Object, e As OftpserverEndTransferEventArgs) Public Class OftpserverEndTransferEventArgs Inherits EventArgs Public ReadOnly Property ConnectionId As String Public ReadOnly Property Direction As Integer Public ReadOnly Property LocalFile As String Public ReadOnly Property VirtualFileName As String Public ReadOnly Property VirtualFileDate As String Public ReadOnly Property Destination As String Public ReadOnly Property Originator As String Public ReadOnly Property ReasonCode As Integer Public ReadOnly Property ReasonText As String Public ReadOnly Property FileSize As Long Public ReadOnly Property FileHash As String Public Property SendEndResponse As Boolean End Class
Remarks
The EndTransfer event is fired when a file is sent or received by the component.
The FileSize parameter gives the size of the file that was sent or received.
The Direction parameter shows whether the client or the server is sending the data.
0 (Client) | The file originated from the client. |
1 (Server) | The file originated from the server. |
VirtualFileName holds the filename.
VirtualFileDate holds the date associated with the file in the format specified by VirtualFileDateFormat. The default value is "MM/dd/yyyy HH:mm:ss".
Originator identifies the sender (SFID) code in the send file request.
Destination identifies the receiver (SFID) code in the send file request.
SendEndResponse indicates whether the EERP/NERP for this request should be sent synchronously or asynchronously. When this parameter is True (default) the component will automatically respond with an EERP/NERP synchronously. To respond asynchronously set this parameter to False. You may then use the SendEndResponse method to send the response at a later time. See SendEndResponse for more details. Note: VirtualFileDateFormat must be set to a format that includes the necessary level of accuracy.
FileHash holds the hash of the file being transmitted. This is only applicable when the OFTP version is 2.0 and the sender requested a signed receipt. When receiving files this value should be saved if you wish to respond asynchronously using SendEndResponse. See SendEndResponse for more details.
LocalFile holds the full path to the file that will be written.
ReasonCode and ReasonText identify the error if a Negative End Response (NERP) was received. A value of 0 indicates there was no an error and the response is an End-To-End Response (EERP). Common values are:
ReasonCode | ReasonText |
3 | User Code Not Known |
4 | Invalid Password |
9 | Unspecified Reason |
11 | Invalid FileName |
12 | Invalid Destination |
13 | Invalid Origin |
14 | Invalid Storage Record Format |
15 | Maximum Record Length Not Supported |
16 | File Size Too Big |
20 | Invalid Record Count |
21 | Invalid Byte Count |
22 | Access Method Failure |
23 | Duplicate File |
24 | File Direction Refused |
25 | Cipher Suite Not Supported |
26 | Encrypted File Not Allowed |
27 | Unencrypted File Not Allowed |
28 | Compression Not Allowed |
29 | Signed File Not Allowed |
30 | Unsigned File Not Allowed |
31 | File Signature Not Valid |
32 | File Decompression Failed |
33 | File Decryption Failed |
34 | File Processing Failed |
35 | Not Delivered To Recipient |
36 | Not Acknowledged By Recipient |
50 | Transmission Stopped By The Operator |
90 | File Size Incompatible With Recipient's Protocol Version |
99 | Unspecified Reason |
ConnectionId identifies the connected client.