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-rangerestricts the uploaded object size to 0–1,048,576,000 bytes.eqrequires OSS to return HTTP 201 on a successful upload.
For the full list of supported condition types and operators, see Appendix: Policy.
References
Appendix: Policy — Policy form field reference for PostObject
Add signatures on the client by using JavaScript and upload data to OSS — How to implement form upload from a web client
Errors and troubleshooting methods of PostObject — Common errors and fixes for the PostObject operation