TsgcWSPClient_FilesEvents › OnFileBeforeSent

OnFileBeforeSent Event

Fires just before the file header leaves the client, letting you inspect or tweak the outgoing TsgcWSMessageFile.

Syntax

property OnFileBeforeSent: TsgcWSFileBeforeEvent;
// TsgcWSFileBeforeEvent = procedure(const aMessage: TsgcWSMessageFile) of object

Default Value

Remarks

At this point aMessage exposes FileName, FileSize, FileId, BufferSize, QoS and the custom Data payload assembled by SendFile. Use the event to log the pending upload, enrich the Data property or abort the transfer by raising an exception.

Example

procedure TForm1.oProtocolFileBeforeSent(const aMessage: TsgcWSMessageFile);
begin
  Memo1.Lines.Add('sending ' + aMessage.FileName);
end;

Back to Events