Canceling a Multipart Upload

You can cancel a multipart upload if you do not want to reconstitute the object. This action deletes the multipart upload and all the parts you already uploaded.

You also need to delete each part you created in the multipart upload.

To ensure your multipart upload is canceled, you can check that the list of uploaded parts is empty. For more information, see Listing Parts in a Multipart Upload.

Canceling a Multipart Upload Using AWS CLI

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To cancel a multipart upload, use the abort-multipart-upload command following this syntax:

Request sample
$ aws s3api abort-multipart-upload \
    --profile YOUR PROFILE \
    --bucket BUCKET \
    --upload-id 2~xrosnH8pbKTk3sjXijfGIUN1KAEM3Yc \

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The bucket in which you want to cancel the multipart upload.

  • key: The name given to the multipart upload you want to cancel.

  • upload-id: The ID of the upload you received when creating a multipart upload. For more information, see Creating a Multipart Upload.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The multipart upload is canceled and deleted, and all its uploaded parts are also deleted.

Related Page

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.