Creating a Multipart Upload
You can create a multipart upload to store large objects in a bucket by dividing them into several smaller parts. A multipart upload can be in one of your buckets or one for which you have the appropriate permissions. You can then upload these parts concurrently, improving throughput for large objects on stable, high-bandwidth networks.
Recovery from network issues is thus quicker with a multipart upload, as each smaller part requires less data re-upload compared to a single large file.
Each part can range from 1 byte to 5 GiB. However, we recommend using multipart upload for objects of 100 MiB or more. Once all parts are uploaded, you can either complete the multipart upload (and reassemble the object in your bucket), or cancel it, removing all parts. This approach ensures efficient use of resources and bandwidth, allowing control over large data transfers. For more information, see Uploading a Part.
You can start uploading parts of an object without knowing its final size, which is useful for real-time object creation. Indeed, there is no time limit to complete the upload. You can pause and resume uploading parts as needed, which is ideal for ongoing projects or inconsistent network access.
You cannot modify the ACL or permissions of the multipart upload once it is created. |
By default, the objects your store are private. However, you can grant access to the objects that you stored in your bucket with other users setting an Access Control List (ACL). For more information, see Access Control List (ACL) Reference.
Creating a Multipart Upload Using AWS CLI
Before you begin:
|
To create a multipart upload, use the create-multipart-upload command following this syntax:
$ aws s3api create-multipart-upload \
--profile YOUR_PROFILE \
--bucket BUCKET \
--key MULTIPART_UPLOAD \
--acl private \
--grant-full-control "id=USER_ID, id=USER_ID" \
--grant-read "id=USER_ID, id=USER_ID" \
--grant-read-acp "id=USER_ID, id=USER_ID" \
--grant-write-acp "id=USER_ID, id=USER_ID" \
--endpoint https://oos.eu-west-2.outscale.com
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 create the multipart upload. -
key
: The name you want to give to the multipart upload. -
(optional)
acl
: The permissions you grant for your bucket (private
|public-read
|public-read-write
|authenticated-read
).-
If you do not specify a permission for your bucket upon creation, it will automatically be set to private.
-
When specifying new permissions, all the previous permissions are replaced. Therefore, you need to specify both the existing permissions that you want to keep and the new permissions that you want to give in a single command.
For more information about existing permissions, see Getting Information About a Bucket ACL and Getting Information About an Object ACL.
-
-
(optional)
grant-full-control
: One or more IDs of users to whom you grant thefull-control
permission. -
(optional)
grant-read
: One or more IDs of users to whom you grant theread
permission. -
(optional)
grant-read-acp
: One or more IDs of users to whom you grant theread-acp
permission. -
(optional)
grant-write
: One or more IDs of users to whom you grant thewrite
permission. -
(optional)
grant-write-acp
: One or more IDs of users to whom you grant thewrite-acp
permission.-
You need to specify S3 user IDs. You can retrieve S3 user IDs via the Listing Your Buckets and Listing the Objects of a Bucket methods.
-
You can also specify user email addresses using the
emailaddress=name@domain.com
format.
-
-
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The create-multipart-upload command returns the following elements:
-
Bucket
: The name of the bucket. -
Key
: The name of the multipart upload. -
UploadId
: The ID of the multipart upload.Save this element as it is mandatory for further commands.
{
"Bucket": "BUCKET",
"Key": "MULTIPART_UPLOAD"
"UploadId": "2~xrosnH8pbKTk3sjXijfGIUN1KAEM3Yc",
}
Related Pages
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.