EndTransfer Event

Fired when a file finishes transferring.


ANSI (Cross Platform)
virtual int FireEndTransfer(OFTPClientEndTransferEventParams *e);
typedef struct {
int Direction;
const char *LocalFile;
const char *VirtualFileName;
const char *VirtualFileDate;
const char *Destination;
const char *Originator;
int ReasonCode;
const char *ReasonText;
int64 FileSize;
const char *FileHash;
int SendEndResponse; int reserved; } OFTPClientEndTransferEventParams; Unicode (Windows) virtual INT FireEndTransfer(OFTPClientEndTransferEventParams *e);
typedef struct {
INT Direction;
LPCWSTR LocalFile;
LPCWSTR VirtualFileName;
LPCWSTR VirtualFileDate;
LPCWSTR Destination;
LPCWSTR Originator;
INT ReasonCode;
LPCWSTR ReasonText;
LONG64 FileSize;
BOOL SendEndResponse; INT reserved; } OFTPClientEndTransferEventParams;
- (void)onEndTransfer:(int)direction :(NSString*)localFile :(NSString*)virtualFileName :(NSString*)virtualFileDate :(NSString*)destination :(NSString*)originator :(int)reasonCode :(NSString*)reasonText :(long long)fileSize :(NSString*)fileHash :(int*)sendEndResponse;

virtual INT IPWORKSEDI_CALL FireEndTransfer(INT &iDirection, LPSTR &lpszLocalFile, LPSTR &lpszVirtualFileName, LPSTR &lpszVirtualFileDate, LPSTR &lpszDestination, LPSTR &lpszOriginator, INT &iReasonCode, LPSTR &lpszReasonText, LONG64 &lFileSize, LPSTR &lpszFileHash, BOOL &bSendEndResponse);


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

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