TsgcHTTP_API_OpenAI › Methods › CancelUpload
Cancels a multipart upload session and discards any parts already transferred
function CancelUpload(const aUploadId: string) : TsgcOpenAIClass_Response_Upload;
| Name | Type | Description |
|---|---|---|
aUploadId | const string | Identifier of the upload session to cancel |
Upload descriptor reflecting the cancelled status (TsgcOpenAIClass_Response_Upload)
Calls the POST /v1/uploads/{upload_id}/cancel endpoint. Use this when an upload cannot be finished (for example due to a client error) so that server resources are released. After cancellation the upload id is no longer valid and no final File object is produced.
oResponse := oAPI.CancelUpload(vUploadId);
ShowMessage('Upload status: ' + oResponse.Status);