Problem description
The policy form field in a PostObject request contains an unsupported parameter.
Causes
The policy form field accepts only two parameters: expiration and conditions. Including any other parameter causes the request to fail with an error.
Examples
The following policy fails because it includes the unsupported test parameter:
{
"test": "test",
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000]
]
}Solutions
Remove any unsupported parameters from the policy form field. The corrected policy contains only expiration and conditions:
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000]
]
}References
For details about the
policyform field, see Appendix: Policy.To learn how to use form upload to transfer data from a web client to OSS, see Add signatures on the client by using JavaScript and upload data to OSS.
For common PostObject errors and how to resolve them, see Errors and troubleshooting methods of PostObject.