Setting the Filename in AS2 Messages


When sending AS2 messages, the filename included in the payload is determined automatically if a file is provided from disk. For example, setting the EDIData.Filename property will use the actual file name in the transmitted message:

as2sender.EDIData.FileName = "C:\\myfile.txt";

In this case, the transmitted filename will be myfile.txt.

If sending data without a physical file, or if a custom filename is required, the EDIData.Name property can be set explicitly to control the name seen by the trading partner:

as2sender.EDIData.Name = "myname.txt";

If no name is specified, the default filename rfc1767.edi is used.

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.