TsgcHTTP_API_OpenAIMethods › CancelUpload

CancelUpload Method

Cancels a multipart upload session and discards any parts already transferred

Syntax

function CancelUpload(const aUploadId: string) : TsgcOpenAIClass_Response_Upload;

Parameters

NameTypeDescription
aUploadIdconst stringIdentifier of the upload session to cancel

Return Value

Upload descriptor reflecting the cancelled status (TsgcOpenAIClass_Response_Upload)

Remarks

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.

Example

oResponse := oAPI.CancelUpload(vUploadId);
ShowMessage('Upload status: ' + oResponse.Status);

Back to Methods