Initiate Multipart Upload

最近更新时间:2020-04-03 03:10:10

Initiate Multipart Upload


Description

This operation will start a block upload task and return upload ID. In a certain block upload task, upload ID is used to associate all blocks. The upload ID in the continuous block upload request is specified by the user. The upload ID is also included in the Complete Multipart Upload and Abort Multipart Upload requests.

As for the problem of request signature, block upload is a series of requests (initialize block upload, upload block, complete block upload, terminate block upload), the user starts the task, sends one or more blocks, and finally completes the task. The user needs to sign each request separately.

Attention When you start to upload in blocks and start to upload in blocks, you must complete or give up the upload task to terminate the charges caused by storage.

Request

Syntax

POST /{ObjectKey}?uploads HTTP/1.1
Host: {BucketName}.{endpoint}
Date: {date}
Authorization: {SignatureValue}

Attention:

Request Parameters

The request does not use the request parameter.

Request Headers

The interface can use all common request headers. For more information, please click Public Request Headers.

Name Description Required
Cache-Control Tell all caching mechanisms whether they can cache and what type. For more information, please click http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html# sec14.9
Type:String
Default:None
Constraints:None
No
Content-Disposition Specifies the representation of the object. For more information, please click http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html# sec19.5.1
Type:String
Default:None
Constraints:None
No
Content-Encoding Specifies the file content encoding format. For more information, please click http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html# sec14.11
Type:String
Default:None
Constraints:None
No
Content-Type Describes the MIME format of the file content. For more information, please click http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html# sec14.17
Type:String
Default:binary/octet-stream
Valid Value: MIME types
Constraints:None
No
Expires Object exists on the cached effective time date. For more information, please click http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html# sec14.21
Type:String
Default:None
Constraints:None
No
x-kss-meta- User metadata prefix ID. If a header prefix is x-kss-meta-, user-defined metadata is used.
Type:String
Default:None
Constraints:None
No
x-kss-storage-class Used to set the object storage class.
Type:String
Default:None
Valid Value:STANDARD/STANDARD_IA/ARCHIVE
Notes:When x-kss-storage-class is not specified, if bucket is archive type, object will be archive type automatically. If bucket is non archive type, object will be standard type automatically. If x-kss-storage-class is specified, storage type will be specified.
Constraints:None
No
ACL Special Headers

Use the preset ACL to set ACL for the newly uploaded object

Name Description Required
x-kss-acl Predefined permissions for the object.
Type:String
Default:private
Valid Value:private &##124; public-read
Constraints:None
No

If you want to set the detailed ACL for the bucket, you can use the following header settings

Name Description Required
x-kss-grant-read Grant READ permission to several users.
Type:String
Default:None
Constraints:None
No
x-kss-grant-full-control Grant FULL_CONTROL permission to several users.
Type:String
Default:None
Constraints:None
No

The value of the above header value is a comma "," separated authorization list. The format of each authorization information is type = value. The current type supports the following types:

For example, to grant read permission to all users: x-kss-grant-read:uri="http://acs.ksyun.com/groups/global/AllUsers"

Request Elements

The interface does not use the requested content.

Response

Response Headers

This interface can use all common response headers. For more information, please click Public Response Headers.

Name Description
x-kss-server-side-encryption If server-side encryption is used to store object, the response will contain the header, and the value is the encryption algorithm used.
Type:String
x-kss-server-side-encryption-customer-algorithm If the server uses the encryption key provided by the user for encryption, the response will include the header to confirm the decryption algorithm used when the request is decrypted.
Type:String
Valid Value:AES256
x-kss-server-side-encryption-customer-key-MD5 If the server uses the encryption key provided by the user for encryption, the response will include the header to provide the data consistency verification information of the encryption key provided by the user when the request is decrypted.
Type:String

Response Elements

Name Description
InitiateMultipartUploadResult Container containing response information
Type:Container
Child Node:Bucket, Key, UploadId
Ancestors:None
Bucket The name of the bucket to start the block upload task
Type:String
Ancestors:InitiateMultipartUploadResult
Key Block upload object's key
Type:String
Ancestors:InitiateMultipartUploadResult
UploadId ID of the block upload task
Type:String
Ancestors:InitiateMultipartUploadResult

Special Errors

The request does not return any special errors.

Examples

Sample Request

POST /my-video.rm ?uploads HTTP/1.1
Host: ks3-example.ks3-cn-beijing.ksyun.com
Date: Wed, 01 Mar 2006 12:00:00 GMT
Authorization: authorization string

Sample Response

HTTP/1.1 200 OK
Date: Mon, 1 Nov 2010 20:34:56 GMT
Content-Length: 197
Connection: keep-alive
Server: Tengine

<?xml version="1.0" encoding="UTF-8"?>
<InitiateMultipartUploadResult xmlns="http://ks3-cn-beijing.ksyun.com/doc/2006-03-01/">
<Bucket>ks3-example</Bucket>
<Key>my-video.rm</Key>
<UploadId>1aa9cfad5e2e405c8f27965feb8b60cc</UploadId>
</InitiateMultipartUploadResult>

Interface Detail Analysis

  • Initialization of block upload will not affect the existing file with the same name. Only after Complete Multipart Upload will the file with the same name be overwritten.
  • The initial block upload will return the UploadId in the body, which will be used in some subsequent column operations.

金山云,开启您的云计算之旅

注册有礼