TApxProtocol.FileName

TApxProtocol

property FileName : string

Determines the name of the file currently being received.

This should be considered a read-only property for all protocols except Xmodem and ASCII, which do not transfer a filename along with the file data. For these two protocols you must assign a value to FileName before calling StartReceive. For the remaining protocols supported by Async Professional CLX, you can read the value of FileName within a protocol status routine to obtain the file name transferred by the protocol.

If FileName does not include path information, the incoming file is stored in the current directory or the directory specified by DestinationDirectory. If FileName includes path information and HonorDirectory is True, the incoming file is stored in that directory regardless of whether a value was assigned to DestinationDirectory.

The following example stores a file received via Xmodem to /tmp/RECEIVE.TMP:

ApxProtocol1.ProtocolType := ptXmodem;
ApxProtocol1.FileName := '/tmp/RECEIVE.TMP';
ApxProtocol1.StartReceive;

See also: DestinationDirectory, HonorDirectory