IPWorks EDI 2020 macOS Edition

Questions / Feedback?

AcceptFile Event

Fired when the client sends a file.

Syntax

func onAcceptFile(connectionId: Int32, virtualFileName: String, virtualFileDate: String, destination: String, originator: String, accept: inout Bool, filename: inout String, overwrite: inout Bool, errorCode: inout Int32, errorDescription: inout String)

Remarks

This event controls the behavior when the client sends a file to the server.

VirtualFileName holds the name of the file being received.

VirtualFileDate holds the date associated with the file in the format specified by VirtualFileDateFormat. The default value is "MM/dd/yyyy HH:mm:ss".

Destination identifies the receiver (SFID) code in the send file request. If the file was intended for this server this will match the value in ServerSFIDCode

Originator identifies the sender (SFID) code in the send file request.

Accept is true by default, and must be set to False in order to reject the file.

Filename will be populated with the full path and filename that will be written. It may be changed within this event to specify a new location. The Filename is determined by combining the path specified in DownloadDirectory and the name received from the client.

Overwrite is false by default, but may be set to true to overwrite existing files on disk.

ErrorCode controls the error returned to the client when Accept is set to False. If this is not set the class will use a value of 99 to indicate a general error.

ErrorDescription may also be set to include an error message. If this is not set the class will automatically include an error message based on the ErrorCode specified. Common error codes and their corresponding error messages are listed below.

ErrorCode ErrorMessage
1 Invalid filename.
2 Invalid destination.
3 Invalid origin.
4 Storage record format not supported.
5 Maximum record length not supported.
6 File size is too big.
10 Invalid record count.
11 Invalid byte count.
12 Access method failure.
13 Duplicate file.
14 File direction refused.
15 Cipher suite not supported.
16 Encrypted file not allowed.
17 Unencrypted file not allowed.
18 Compression not allowed.
19 Signed file not allowed.
20 Unsigned file not allowed.
99 Unspecified reason.

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