0006-00000218
Error code 0006-00000218 indicates that the value of a condition in the conditions list of the policy form field is invalid. When you call the PostObject operation to upload an object with such a policy form field, the request fails.
Cause
The policy form field of the PostObject request contains a condition in the conditions list whose format or value does not match what the PostObject operation requires. As a result, the request fails.
In the following policy form field, the $key condition in the conditions list contains an extra parameter. The condition therefore does not match the format that PostObject requires.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["starts-with", "$key", "user/user1", "test"]
]
}Solution
Make sure that the format and the value of each condition in the conditions list of the policy form field are valid. The following policy form field contains valid conditions:
{
"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"]]
]
}References
For details about the
policyform field, see Appendix: Policy.For an example of uploading data to OSS directly from a web form, see Add signatures on the client by using JavaScript and upload data to OSS.
For common errors and troubleshooting methods of the PostObject operation, see Errors and troubleshooting methods of PostObject.