InitiateMultipartUpload
Updated at:2025-11-03
API description
InitiateMultipartUpload is the first step in the MultipartUpload process. This command requests a globally unique UploadId from BOS to identify the MultipartUpload. The UploadId is necessary for the second and third steps in the process. Users can also query upload progress or cancel the upload using the UploadId.
Request
-
Request syntax
Plain Text1POST /<ObjectName>?uploads HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3Date: <Date> 4Authorization: <AuthorizationString> 5Content-Type: text/plain 6Content-Length: <ContentLength> 7x-bce-storage-class: <StorageClass> -
Request headers
Name Types Description Whether required x-bce-storage-class String Specify the storage class of the BOS object, supporting STANDARD,STANDARD_IA,COLD, andARCHIVE, defaulting toSTANDARD; if it is multi-AZ bucket,MAZ_STANDARD_IArepresents multi-AZ infrequent access storage; if unspecified, it defaults toMAZ_STANDARDmulti-AZ standard storage, rather than other options.No x-bce-acl String CannedACL supports a header that allows users to set object permissions as either "private" or "public-read.\ No x-bce-grant-read String Headers supported by CannedACL allow users to set read permissions for an object. Multiple IDs can be set and should be separated by commas. No x-bce-grant-full-control String Headers supported by CannedACL allow users to set FULL_CONTROL permissions for an object. Multiple IDs can be set and should be separated by commas. No x-bce-server-side-encryption String Server-Side Encryption (SSE) supports AES256 and SM4 encryption algorithms. No Cache-Control String Cache settings for downloading the Object. Common values include private,no-cache,max-ageandmust-revalidateNo Content-Disposition String Set whether to download the browser. Options: inline,attachment; filename="download.txt"No Expires String Set cache expiration time when the object is downloaded No x-bce-copy-source String Set the source for three-step upload, bucket/object No -
Request parameters
| Name | Types | Parameter location | Description | Whether required |
|---|---|---|---|---|
| uploads | String | Query | Request for multipart upload | Yes |
Response
| Name | Types | Description |
|---|---|---|
| bucket | String | Bucket name |
| key | String | Object name |
| uploadId | String | A globally unique ID, used to identify this MultiUpload operation |
Plain Text
1> **Note**
2>
3> 1. If Content-Type is not specified for objects uploaded by MultipartUpload, BOS will automatically recognize and set an appropriate Content-Type. If unrecognized, it defaults to `application/octet-stream`.
4> 2. The UploadId obtained from InitiateMultipartUpload is used in the second and third steps of MultiUpload. It can also be used to check the upload's progress or cancel the upload altogether.
5> 3. The retrieved UploadId is also used for the subsequent UploadPartCopy operation. If the copy source is an append object larger than 5 GB, the x-bce-copy-source header must be specified during initialization. Note that the copy source must be an append object over 5 GB; smaller objects are not supported.
Example
-
Example of standard storage request
Plain Text1POST /ObjectName?uploads 2Host: BucketName.bj.bcebos.com 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Authorization: AuthorizationString 5Content-Length: 0 -
Example of infrequent access/cold storage request
Plain Text1POST /ObjectName?uploads 2Host: BucketName.bj.bcebos.com 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Authorization: AuthorizationString 5Content-Length: 0 6x-bce-storage-class: STANDARD_IA -
Response example
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 3Date: Wed, 06 Apr 2016 06:34:40 GMT 4Content-Length: 197 5Connection: keep-alive 6Server: BceBos 7{ 8 "bucket": "BucketName", 9 "key":"ObjectName", 10 "uploadId": "a44cc9bab11cbd156984767aad637851" 11}
