TsgcWSPServer_FilesMethods › BroadcastFile

BroadcastFile Method

Broadcasts a file to every connected client, optionally filtered by channel, include and exclude lists.

Overloads

Overload 1

Syntax

procedure BroadcastFile(aFileName: string; aSize: Integer; aData: string; aChannel: string = ''; Exclude: String = ''; Include: String = ''; aFileId: String = '');

Parameters

NameTypeDescription
aFileNamestringFull path to the file that will be broadcast.
aSizeIntegerSize in bytes of every packet the file is chunked into.
aDatastringOptional user data travelling with the file header; forwarded to every receiver.
aChannelstringWhen non-empty, restricts delivery to clients subscribed to this channel.
ExcludeStringComma-separated list of connection guids that must not receive the file.
IncludeStringComma-separated list of connection guids that are the only ones to receive the file.
aFileIdStringOptional file identifier; auto-generated when left empty.

Remarks

Uses Files.QoS.Level as the effective QoS. Pass an empty aChannel to broadcast to every connected client.

Example

oFiles.BroadcastFile('C:\Docs\update.zip', 32768, 'release-2026-04', 'news');

Overload 2

Syntax

procedure BroadcastFile(aFileName: string; aSize: Integer; aData: string; aQoS: TwsQoS; aChannel: string = ''; Exclude: String = ''; Include: String = ''; aFileId: String = '');

Parameters

NameTypeDescription
aFileNamestringFull path to the file that will be broadcast.
aSizeIntegerSize in bytes of every packet the file is chunked into.
aDatastringOptional user data travelling with the file header; forwarded to every receiver.
aQoSTwsQoSQuality of service: qosLevel0, qosLevel1 or qosLevel2.
aChannelstringWhen non-empty, restricts delivery to clients subscribed to this channel.
ExcludeStringComma-separated list of connection guids that must not receive the file.
IncludeStringComma-separated list of connection guids that are the only ones to receive the file.
aFileIdStringOptional file identifier; auto-generated when left empty.

Remarks

Full overload with explicit QoS. For qosLevel2 the file is delivered per-client using the QoS Level 2 flow so each receiver can individually resume the transfer.

Example

oFiles.BroadcastFile('C:\Docs\update.zip', 32768, 'release-2026-04', qosLevel2, 'news');

Back to Methods