Internet Direct (Indy) Version 9.0.1 Beta
TAccessFileEvent
Specifies an event type for reading or writing to a file on the server.

TAccessFileEvent = procedure (Sender: TObject; var FileName: String; const PeerInfo: TPeerInfo; var GrantAccess: Boolean; var AStream: TStream; var FreeStreamOnComplete: Boolean) of object;
Description
TAccessFileEvent is an event type that signalled when a Trivial FTP server needs to access the contents of a file stored on the local file system on the server.

FileName indicates the name of the file on the server file system.

PeerInfo contain the PeerIp and PeerPort for the client connection performing the file access that generated the event notification.

When GrantAccess is True, the file operation for the event has been is permitted. False indicates that the operation was not permitted or an error has occurred. Update GrantAccess in a TAccessFileEvent event handler to reflect the state of the operation.

AStream contains the data to be written to the local file system as a result of the file operation.

When FreeStreamOnCompleteis True, the TAccessFileEvent event handler should free the stream in AStream.