TsgcWSPServer_Files › Methods › SendFile
Sends a file to a single connected client identified by its connection guid.
procedure SendFile(aGuid, aFileName: string; aSize: Integer; aQoS: TwsQoS; aData: String; aFileId: String = '');
| Name | Type | Description |
|---|---|---|
aGuid | string | Guid of the target client connection. |
aFileName | string | Full path to the file that will be sent. |
aSize | Integer | Size in bytes of every packet the file is chunked into. |
aQoS | TwsQoS | Quality of service: qosLevel0 (fire-and-forget), qosLevel1 (acknowledged) or qosLevel2 (acknowledged + fragment-requested). |
aData | String | Optional user data travelling with the file header; forwarded to the receiver in the message metadata. |
aFileId | String | Optional file identifier; auto-generated when left empty. |
Full overload with explicit buffer size and QoS. For qosLevel0 / qosLevel1 the server streams the file to the client; for qosLevel2 the server waits for the receiver to request fragments so interrupted transfers can be resumed.
oFiles.SendFile(aConnection.Guid, 'C:\Docs\report.pdf', 32768, qosLevel2, 'invoice', '');
procedure SendFile(aGuid, aFileName: string);
| Name | Type | Description |
|---|---|---|
aGuid | string | Guid of the target client connection. |
aFileName | string | Full path to the file that will be sent. |
Convenience overload that uses Files.BufferSize and Files.QoS.Level as defaults and sends the file with no accompanying user data.
oFiles.SendFile(aConnection.Guid, 'C:\Docs\report.pdf');