Problem description
A condition that is specified by the conditions parameter in the policy form field is not of the map or list type.
Causes
You initiated a PostObject request to upload an object. However, a condition that is specified by the conditions parameter in the policy form field is not of the map or list type. As a result, an error is returned.
Examples
The error is returned because the first condition that is specified by the conditions parameter in the policy form field is 123. Each condition that is specified by the conditions parameter in the policy form field must be of the map or list type.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
123,
["content-length-range", 10, 1024]
]
}Solutions
Make sure that each item that is specified by the conditions parameter in the policy form field is a condition of the map or list type.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 1, 1024],
["eq", "$success_action_status", "201"],
["starts-with", "$key", "user/eric/"],
["in", "$content-type", ["image/jpg", "image/png"]],
["not-in", "$cache-control", ["no-cache"]]
]
}References
For more information about the policy form field, see Appendix: Policy.
For information about how to transfer data from the web client to OSS by using form upload, see Add signatures on the client by using JavaScript and upload data to OSS.
For information about common errors and troubleshooting methods of the PostObject operation, see Errors and troubleshooting methods of PostObject.