Updated on 2026-05-26 GMT+08:00

Aborting a Multipart Upload

Function

You can call this API to abort a multipart upload. For details about the multipart upload, see Multipart Upload. You cannot upload or list parts after operations to merge parts or abort a multipart upload are performed.

Authorization

To call this API, you must be the bucket owner or have the permission to abort multipart uploads. You are advised to use IAM or bucket policies for authorization. For details about OBS authorization methods, see Differences Between OBS Permissions Control Methods.

  • If you use IAM for authorization, you need to use either role/policy-based authorization or identity policy-based authorization and configure the required permissions:
    • If you use role/policy-based authorization (IAM v3 APIs in the old IAM version), you must have the obs:object:AbortMultipartUpload permission. For details, see Creating a Custom IAM Policy.
    • If you use identity policy-based authorization (IAM v5 APIs in the new IAM version), you must have the obs:object:abortMultipartUpload permission, as shown in the following table. For details, see Creating a Custom IAM Identity Policy.

      Action

      Access Level

      Resource Type (*: Required)

      Condition Key

      Alias

      Dependencies

      obs:object:abortMultipartUpload

      Write

      object *

      -

      g:EnterpriseProjectId

      -

      -

      • obs:EpochTime
      • obs:SourceIp
      • obs:TlsVersion
      • obs:CustomDomain
  • If you use bucket policies for authorization, you must have the obs:object:AbortMultipartUpload permission. For details, see Creating a Custom Bucket Policy.

URI

DELETE /{object_key}

Calling Method

For details, see Calling APIs. Before calling this API, calculate the API signature and add it to the request.

You can debug this API in API Explorer.

Request Syntax

1
2
3
4
DELETE /ObjectName?uploadId=uploadID HTTP/1.1 
Host: bucketname.obs.region.myhuaweicloud.com 
Date: date
Authorization: auth

URI Parameters

This request uses message parameters to specify the multipart upload task number. Table 1 describes the parameters.

Table 1 URI parameters

Parameter

Mandatory

Type

Description

uploadId

Yes

String

Definition

ID of the multipart upload

Constraints

N/A

Range

The value must contain 1 to 32 characters.

Default Value

N/A

Request Headers

This request uses common headers. For details, see Table 3.

Request Body

This request contains no request body parameters.

Response Syntax

HTTP/1.1 status_code
Date: date

Response Headers

This response uses common headers. For details, see Table 1.

Response Body

This response contains no elements.

Error Responses

  1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
  2. If the requested bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
  3. If you are neither the initiator of a multipart upload nor the bucket owner, OBS returns 403 Forbidden.
  4. If the operation is successful, OBS returns 204 No Content to the user.

Other errors are included in Table 2.

Sample Request

1
2
3
4
5
6
DELETE /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.myhuaweicloud.com
Accept: */*
Date: WED, 01 Jul 2015 05:28:27 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:QmM2d1DBXZ/b8drqtEv1QJHPbM0=

Sample Response

1
2
3
4
5
HTTP/1.1 204 No Content
Server: OBS
x-obs-request-id: 8DF400000163D463E02A07EC2295674C
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTp5YDlzn0UgqG3laRfkHLGyz7RpR9ON
Date: WED, 01 Jul 2015 05:28:27 GMT