0006-00000218

更新时间:
复制 MD 格式

Problem description

The value of a condition in the conditions array of the Post Policy is invalid.

Cause

Your PostObject request to upload an object failed because a condition in the conditions array of the Post Policy form field has an invalid value.

Example

In the following Post Policy, the starts-with condition for $key is invalid because it contains an extra parameter.

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
      	["starts-with", "$key", "user/user1", "test"]
    ]
}

Solution

Ensure that the format and value of each condition are correct.

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [    
        ["content-length-range", 1, 1024],
        ["eq", "$success_action_status", "201"],
        ["starts-with", "$key", "user/user1/"],
        ["in", "$content-type", ["image/jpeg", "image/png"]],
        ["not-in", "$cache-control", ["no-cache"]]
    ]
}

Related documents