TsgcWSPServer_Files › Events › OnFileSentFragmentRequest
Fired when the receiver requests the next fragment under QoS Level 2; allows cancelling the transfer.
property OnFileSentFragmentRequest: TsgcWSFileFragmentRequestEvent;
// TsgcWSFileFragmentRequestEvent = procedure(const aMessage: TsgcWSMessageFile; var Cancel: Boolean) of object
—
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.
procedure TForm1.oFilesFileSentFragmentRequest(const aMessage: TsgcWSMessageFile; var Cancel: Boolean);
begin
ProgressBar1.Position := Round((aMessage.FilePosition / aMessage.FileSize) * 100);
end;