InitiateMultipartUpload
Last Updated:2021-12-08
Interface Description
InitiateMultipartUpload is the first step of MultipartUpload. This command requests a globally unique UploadId from BOS to represent this MultipartUpload. This UploadId is required in the next two steps of MultipartUpload. The requester can also query the upload progress or abort this upload operation through this UploadId.
Request
-
Request syntax
POST /<ObjectName>?uploads HTTP/1.1 Host: <BucketName>.bj.bcebos.com Date: <Date> Authorization: <AuthorizationString> Content-Type: text/plain Content-Length: <ContentLength> x-bce-storage-class: <StorageClass>
-
Request header field
Name Type Description Required? x-bce-storage-class String It specifies the storage type of the BOS object. At present, it can be STANDARD
,STANDARD_IA
,COLD
andARCHIVE
. It isSTANDARD
by default. If it is a multi-AZ bucket,MAZ_STANDARD_IA
represents the multi-AZ infrequent access. If it is not specified,MAZ_STANDARD
represents the multi-AZ standard storage by default, and it cannot be other values.No x-bce-acl String Header supported by CannedACL, in which the user sets the permission of the object, whose value is private or public-read. No x-bce-grant-read String Header supported by CannedACL, in which the user sets the read permission of the object. It supports multiple IDs separated by commas No x-bce-grant-full-control String Header supported by CannedACL, in which the user sets the FULL_CONTROL permission of the object. It supports multiple IDs separated by commas No x-bce-server-side-encryption String Server encryption algorithm, only AES256 is supported currently. No Cache-Control String Cache setting for downloading the object. The common optional values are private
,no-cache
,max-age
andmust-revalidate
No Content-Disposition String Set the browser to download files. The optional values are inline
andattachment
. Filename="download.txt".No Expires String It sets the cache expiration date during the object download. No -
Request parameters
Name Type Parameter Position Description Required? uploads String Query Parameter MultiPartUpload request Yes
Response
-
Response header field
None
-
Response element
Name Type Description bucket String Bucket name key String Object Name uploadId String Globally unique ID, which is used to identify this MultiUpload operation. Considerations
- For the object uploaded with MultipartUpload, Content-Type must be specified in the first step InitMultipartUpload. If it is not specified, it is
application/octet-stream
by default. - The UploadId got by InitiateMultipartUpload is used for the next two steps of MultiUpload, or used to query the progress of the whole MultiUpload and abort this MultiUpload operation.
- For the object uploaded with MultipartUpload, Content-Type must be specified in the first step InitMultipartUpload. If it is not specified, it is
Example
-
Request example of standard storage
POST /ObjectName?uploads Host: BucketName.bj.bcebos.com Date: Wed, 06 Apr 2016 06:34:40 GMT Authorization: AuthorizationString Content-Length: 0
-
Example of infrequent access/cold storage request
POST /ObjectName?uploads Host: BucketName.bj.bcebos.com Date: Wed, 06 Apr 2016 06:34:40 GMT Authorization: AuthorizationString Content-Length: 0 x-bce-storage-class: STANDARD_IA
-
Response example
HTTP/1.1 200 OK x-bce-request-id: 4db2b34d-654d-4d8a-b49b-3049ca786409 Date: Wed, 06 Apr 2016 06:34:40 GMT Content-Length: 197 Connection: keep-alive Server: BceBos { "bucket": "BucketName", "key":"ObjectName", "uploadId": "a44cc9bab11cbd156984767aad637851" }