0006-00000214

更新时间:
复制 MD 格式

Problem description

The value of the conditions parameter in the policy form field is invalid.

Causes

The conditions parameter must be a JSON array. If it is set to any other type, OSS rejects the PostObject request.

Examples

The following example triggers the error because conditions is set to the integer 123 instead of an array:

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": 123
}

Solutions

Set conditions to a JSON array. Each element in the array defines one condition that OSS enforces on the request.

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
        ["content-length-range", 0, 1048576000],
        ["eq", "$success_action_status", "201"]
    ]
}

In this example:

  • content-length-range restricts the uploaded object size to 0–1,048,576,000 bytes.

  • eq requires OSS to return HTTP 201 on a successful upload.

For the full list of supported condition types and operators, see Appendix: Policy.

References