TsgcWSPServer_FilesEvents › OnFileSentFragmentRequest

OnFileSentFragmentRequest Event

Fired when the receiver requests the next fragment under QoS Level 2; allows cancelling the transfer.

Syntax

property OnFileSentFragmentRequest: TsgcWSFileFragmentRequestEvent;
// TsgcWSFileFragmentRequestEvent = procedure(const aMessage: TsgcWSMessageFile; var Cancel: Boolean) of object

Default Value

Remarks

Only used by the qosLevel2 flow: the receiver requests each fragment explicitly so transfers can be resumed. Use aMessage.FilePosition to display server-side progress. Set Cancel to True to abort the transfer and raise OnFileSentError.

Example

procedure TForm1.oFilesFileSentFragmentRequest(const aMessage: TsgcWSMessageFile; var Cancel: Boolean);
begin
  ProgressBar1.Position := Round((aMessage.FilePosition / aMessage.FileSize) * 100);
end;

Back to Events