| Did this page help you? Yes No Tell us about it... |
You can abort an in-progress multipart upload by calling the
AmazonS3.abortMultipartUpload method. This method deletes
any parts that were uploaded to Amazon S3 and frees up the resources. You must
provide the upload ID, bucket name, and the key name. The following Java code sample
demonstrates how you can abort a multipart upload in progress.
AWSCredentials myCredentials = new
BasicAWSCredentials(myAccessKeyID, mySecretKey);
InitiateMultipartUploadRequest initRequest =
new InitiateMultipartUploadRequest(existingBucketName, keyName);
InitiateMultipartUploadResult initResponse =
s3Client.initiateMultipartUpload(initRequest);
AmazonS3 s3Client = new AmazonS3Client(myCredentials);
s3Client.abortMultipartUpload(new AbortMultipartUploadRequest(
existingBucketName, keyName, initResponse.getUploadId()));![]() | Note |
|---|---|
Instead of a specific multipart upload, you can abort all your multipart uploads initiated before a specific time that are still in progress. This clean-up operation is useful to abort old multipart uploads that you initiated but neither completed or aborted. For more information, see Abort Multipart Uploads. |