0002-00000702

更新时间:
复制 MD 格式

Problem description

The policy form field is missing from a PostObject request.

Causes

A PostObject request was sent with signature authentication, but the policy form field was not included. When uploading objects by calling the PostObject operation with signature, the policy form field is required — OSS uses the policy document to verify that the request meets the specified conditions before allowing the upload.

Examples

The following request includes OSSAccessKeyId and Signature but omits the policy field:

POST / HTTP/1.1
Host: <bucket-name>.oss-<region>.aliyuncs.com
Content-Type: multipart/form-data; boundary=----FormBoundary

------FormBoundary
Content-Disposition: form-data; name="OSSAccessKeyId"

<your-access-key-id>
------FormBoundary
Content-Disposition: form-data; name="Signature"

<calculated-signature>
------FormBoundary
Content-Disposition: form-data; name="key"

<object-key>
------FormBoundary
Content-Disposition: form-data; name="file"; filename="example.txt"
Content-Type: text/plain

<file-content>
------FormBoundary--

This request is missing the policy form field that is required when signature authentication is used.

Solutions

Add the policy form field to the PostObject request. When uploading with signature, you must include the policy field together with the other signature-related fields:

Form fieldRoleRequired
OSSAccessKeyIdIdentifies your Alibaba Cloud accountConditional — required when policy is present
policyDefines the conditions the request must satisfyRequired when uploading with signature
SignatureSignature of the policy documentConditional — required when policy is present

The policy value is a Base64-encoded, UTF-8 JSON document that specifies the conditions the PostObject request must meet.

For the full list of supported policy conditions and signature calculation steps, see PostObject.