TsgcWSPServer_Files › Methods › BroadcastFile
Broadcasts a file to every connected client, optionally filtered by channel, include and exclude lists.
procedure BroadcastFile(aFileName: string; aSize: Integer; aData: string; aChannel: string = ''; Exclude: String = ''; Include: String = ''; aFileId: String = '');
| Name | Type | Description |
|---|---|---|
aFileName | string | Full path to the file that will be broadcast. |
aSize | Integer | Size in bytes of every packet the file is chunked into. |
aData | string | Optional user data travelling with the file header; forwarded to every receiver. |
aChannel | string | When non-empty, restricts delivery to clients subscribed to this channel. |
Exclude | String | Comma-separated list of connection guids that must not receive the file. |
Include | String | Comma-separated list of connection guids that are the only ones to receive the file. |
aFileId | String | Optional file identifier; auto-generated when left empty. |
Uses Files.QoS.Level as the effective QoS. Pass an empty aChannel to broadcast to every connected client.
oFiles.BroadcastFile('C:\Docs\update.zip', 32768, 'release-2026-04', 'news');
procedure BroadcastFile(aFileName: string; aSize: Integer; aData: string; aQoS: TwsQoS; aChannel: string = ''; Exclude: String = ''; Include: String = ''; aFileId: String = '');
| Name | Type | Description |
|---|---|---|
aFileName | string | Full path to the file that will be broadcast. |
aSize | Integer | Size in bytes of every packet the file is chunked into. |
aData | string | Optional user data travelling with the file header; forwarded to every receiver. |
aQoS | TwsQoS | Quality of service: qosLevel0, qosLevel1 or qosLevel2. |
aChannel | string | When non-empty, restricts delivery to clients subscribed to this channel. |
Exclude | String | Comma-separated list of connection guids that must not receive the file. |
Include | String | Comma-separated list of connection guids that are the only ones to receive the file. |
aFileId | String | Optional file identifier; auto-generated when left empty. |
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.
oFiles.BroadcastFile('C:\Docs\update.zip', 32768, 'release-2026-04', qosLevel2, 'news');