Problem description
The part size for a client-side encrypted multipart upload does not match the part size specified in the InitiateMultipartUpload request.
Problem cause
When you use client-side encryption, the size of the data uploaded in an UploadPart operation does not match the expected size.
For client-side encryption, the InitiateMultipartUpload request must include the x-oss-meta-client-side-encryption-part-size request header. In subsequent UploadPart operations, the size of the uploaded data for every part except the last one must match the size specified in this header. This error occurs because the size of the uploaded data is different from the size specified in the InitiateMultipartUpload request.
Problem example
For example, you initiate an InitiateMultipartUpload request:
POST /multipart.data?uploads HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Wed, 22 Feb 2012 08:32:21 GMT
x-oss-storage-class: Archive
Authorization: OSS qn6q**************:77Dv****************
x-oss-meta-client-side-encryption-data-size: 2048
x-oss-meta-client-side-encryption-part-size: 1024Then, you initiate an UploadPart request:
PUT /multipart.data?partNumber=1&uploadId=0004B9895DBBB6EC9**** HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 6291456
Date: Wed, 22 Feb 2012 08:32:21 GMT
Authorization: OSS qn6q**************:77Dv****************
x-oss-meta-client-side-encryption-part-size: 1024
[6291456 bytes data]The request fails because the uploaded data size does not match the expected size.
Solutions
Ensure that the size of the data uploaded in an UploadPart request matches the part size specified in the InitiateMultipartUpload request.