TsgcWSPClient_Files › Events › OnFileSentFragmentRequest
Fires each time the client is about to send a new outbound file fragment; ideal for upload progress and cancellation.
property OnFileSentFragmentRequest: TsgcWSFileFragmentRequestEvent;
// TsgcWSFileFragmentRequestEvent = procedure(const aMessage: TsgcWSMessageFile; var Cancel: Boolean) of object
—
aMessage.FilePosition tells you how many bytes have already been pushed, aMessage.FileSize the total length. Set Cancel to True to abort: the sent stream and QoS queue entry are released and an error is reported through OnFileSentError. Fires only for qosLevel2 fragmented uploads.
procedure TForm1.oProtocolFileSentFragmentRequest(const aMessage: TsgcWSMessageFile;
var Cancel: Boolean);
begin
ProgressBar1.Position := Round(aMessage.FilePosition / aMessage.FileSize * 100);
end;