TsgcWSPClient_Files › Methods › SendFile
Uploads a file to the server in fragmented chunks with configurable QoS.
procedure SendFile(aFileName: String; aSize: Integer; aQoS: TwsQoS; aData: String; aFileId: String = '');
| Name | Type | Description |
|---|---|---|
aFileName | String | Full path to the local file that will be uploaded. |
aSize | Integer | Size in bytes of every fragment sent to the server. Pass 0 to send the file in a single chunk. |
aQoS | TwsQoS | Quality of service: qosLevel0 fire-and-forget, qosLevel1 acknowledged, qosLevel2 acknowledged with fragment-request and resume support. |
aData | String | Free-form custom payload forwarded to the server (for example a destination path, tag or auth token). |
aFileId | String | Optional file identifier; when empty a new Guid is assigned automatically. |
Full-control overload. OnFileBeforeSent fires before the header leaves, OnFileSentFragmentRequest fires per fragment and OnFileSent fires when the server confirms reception. For qosLevel2 the transfer is queued so it can resume after a reconnection.
oProtocol.SendFile('C:\photos\beach.jpg', 32768, qosLevel2, 'album=holiday');
procedure SendFile(aFileName: String);
| Name | Type | Description |
|---|---|---|
aFileName | String | Full path to the local file that will be uploaded. |
Convenience overload that reuses the defaults declared in Files.BufferSize and Files.QoS.Level, leaving the custom data and file id empty.
oProtocol.SendFile('C:\reports\report.pdf');