IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

EndTransfer Event

Fired when a file finishes transferring.

Syntax

oftpserver.on('EndTransfer', [callback])

Callback

The 'callback' is called when the 'EndTransfer' event is emited.

function(e){ }

The argument 'e' has the following properties:

e.connectionId
e.direction
e.localFile
e.virtualFileName
e.virtualFileDate
e.destination
e.originator
e.reasonCode
e.reasonText
e.fileSize
e.fileHash
e.sendEndResponse

Remarks

The EndTransfer event is fired when a file is sent or received by the class.

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

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]