on_end_transfer Event
Fired when a file finishes transferring.
Syntax
class OFTPServerEndTransferEventParams(object): @property def connection_id() -> int: ... @property def direction() -> int: ... @property def local_file() -> str: ... @property def virtual_file_name() -> str: ... @property def virtual_file_date() -> str: ... @property def destination() -> str: ... @property def originator() -> str: ... @property def reason_code() -> int: ... @property def reason_text() -> str: ... @property def file_size() -> int: ... @property def file_hash() -> str: ... @property def send_end_response() -> bool: ... @send_end_response.setter def send_end_response(value) -> None: ... # In class OFTPServer: @property def on_end_transfer() -> Callable[[OFTPServerEndTransferEventParams], None]: ... @on_end_transfer.setter def on_end_transfer(event_hook: Callable[[OFTPServerEndTransferEventParams], None]) -> None: ...
Remarks
The on_end_transfer 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 send_end_response method to send the response at a later time. See send_end_response 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 send_end_response. See send_end_response 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.