Uploads one part of a multipart upload to OSS, using the object name and upload ID to identify the target upload.
Prerequisites
Before you begin, ensure that you have:
An upload ID obtained by calling
InitiateMultipartUploadThe
oss:PutObjectpermission on the target bucket, granted via RAM Policy or Bucket Policy
Syntax
ossutil api upload-part --bucket <value> --key <value> --upload-id <value> --part-number <value> --body <value> [flags]| Parameter | Type | Required | Description |
|---|---|---|---|
--bucket | string | Yes | Name of the bucket. |
--key | string | Yes | Full path of the object. |
--upload-id | string | Yes | ID of the multipart upload task. |
--part-number | string | Yes | Number that identifies the part. |
--body | string | Yes | The request body which must carry complete data of a single part. Cannot be blank. |
For all supported global flags, see Command-line options.
Usage notes
Call
InitiateMultipartUploadbefore callingupload-partto get an upload ID.Each part number uniquely identifies a part.
Uploading a new part with the same part number overwrites the previously uploaded part with that number.
OSS returns the MD5 hash of each received part in the
ETagresponse header.
Permissions
Alibaba Cloud accounts have full permissions by default. RAM users and RAM roles have no permissions by default and must be granted access via RAM Policy or Bucket Policy.
| API | Action | Description |
|---|---|---|
| UploadPart | oss:PutObject | Uploads parts. |
For more information, see the UploadPart API reference.
Example
Upload the first part of an object:
ossutil api upload-part --bucket examplebucket --key exampleobject --upload-id 123 --part-number 1 --body file://partFile