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
For more information about Post Policy, see Appendix: Post Policy.
For an example of form upload to OSS from a web client, see Client-side signing with JavaScript.
For information about common errors and solutions when you call the PostObject API, see PostObject errors and troubleshooting.
该文章对您有帮助吗?