Use UploadPartCopy
with an AWS SDK or CLI
The following code examples show how to use UploadPartCopy
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- AWS CLI
-
To upload part of an object by copying data from an existing object as the data source
The following
upload-part-copy
example uploads a part by copying data from an existing object as a data source.aws s3api upload-part-copy \ --bucket
amzn-s3-demo-bucket
\ --key"Map_Data_June.mp4"
\ --copy-source"amzn-s3-demo-bucket/copy_of_Map_Data_June.mp4"
\ --part-number1
\ --upload-id"bq0tdE1CDpWQYRPLHuNG50xAT6pA5D.m_RiBy0ggOH6b13pVRY7QjvLlf75iFdJqp_2wztk5hvpUM2SesXgrzbehG5hViyktrfANpAD0NO.Nk3XREBqvGeZF6U3ipiSm"
Output:
{ "CopyPartResult": { "LastModified": "2019-12-13T23:16:03.000Z", "ETag": "\"711470fc377698c393d94aed6305e245\"" } }
-
For API details, see UploadPartCopy
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Developing with Amazon S3 using the AWS SDKs. This topic also includes information about getting started and details about previous SDK versions.