0006-00000227
Problem description
A form field that does not meet the matching conditions specified by the conditions parameter in the policy form field of the PostObject request exists.
Causes
You initiate a PostObject request to upload a file. However, a form field that does not meet the matching conditions specified by the conditions parameter in the policy form field of the PostObject request exists.
Examples
The following code provides an example. In this example, the first parameter of the eq match condition is success_action_status and the second parameter is 200 in the policy form field in JSON format, which indicates that the value of the success_action_status parameter in the policy form field of the request body must be 200. If the value of the success_action_status form field is not 200, an error is returned.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["eq", "success_action_status", "200"]
]
}
Solutions
Make sure that the conditions specified by the conditions parameter in the policy form field of the request are met. You can obtain the condition that is not specified by the conditions parameter from the returned error message.
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>
Invalid according to Policy:
Policy Condition failed:
["eq", "$success_action_status", "200"]
</Message>
<RequestId>63F1D24***4808C1F</RequestId>
<HostId>example-bucket.oss-cn-hangzhou.aliyuncs.com</HostId>
<EC>0006-00000227</EC>
</Error>
The condition that is not specified by the conditions parameter is included in the Message field. You can troubleshoot the issue based on the information provided in this field.
References
-
For more information about the policy form field, see Appendix: Policy.
-
For information about how to transfer data from a 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.