The upload-part command is used to upload data in parts based on the specified name and upload ID of an object.
Notes
Before you call the UploadPart operation to upload data in parts, you must call the InitiateMultipartUpload operation to obtain an upload ID that is generated by OSS.
If you use the same partNumber to upload a new part, the existing part that is uploaded by using the partNumber is overwritten.
OSS includes the MD5 hash of each received part in the ETag header of the response.
Permissions
By default, an Alibaba Cloud account has full permissions. RAM users or RAM roles under an Alibaba Cloud account do not have any permissions by default. The Alibaba Cloud account or account administrator must grant operation permissions through RAM Policy or Bucket Policy.
API | Action | Definition |
UploadPart |
| Uploads parts. |
Syntax
ossutil api upload-part --bucket value --key value --part-number value --upload-id value [flags]Parameter | Type | Description |
--bucket | string | Name of the bucket. |
--key | string | Full path of the object. |
--body | string | The request body which must carry complete data of a single part. This value of this parameter cannot be left empty. |
--part-number | string | This parameter specifies a number that identifies a part. |
--upload-id | string | ID of the MultipartUpload task. |
The upload-part command corresponds to the UploadPart API operation. For more information about the parameters within, see UploadPart.
For more information about supported global command-line options, see Command-line options.
Example
The following code provides an example of how to upload data in parts based on the specified name and upload ID of an object.
ossutil api upload-part --bucket examplebucket --key exampleobject --upload-id 123 --part-number 1 --body file://partFile