Problem description
The policy form field in a PostObject request does not contain a valid JSON structure.
Cause
OSS first decodes the value of the policy form field from Base64. The request fails if the decoded value is not a valid JSON structure.
Example
None
Solutions
Ensure the
policyform field value is a valid JSON structure before encoding. To generate the final value, first UTF-8 encode the JSON string, and then Base64 encode the result.{ "expiration": "2014-12-01T12:00:00.000Z", "conditions": [ {"bucket": "johnsmith" }, ["content-length-range", 1, 10], ["eq", "$success_action_status", "201"], ["starts-with", "$key", "user/eric/"], ["in", "$content-type", ["image/jpeg", "image/png"]], ["not-in", "$cache-control", ["no-cache"]] ] }If the
content-length-rangeparameter is included in theConditionslist of a request, both the minimum and maximum allowed sizes of the uploaded Object must be positive integers. For example,["content-length-range", 1, 10].
References
For more information about Post Policy, see Appendix: Post Policy.
For an example of a direct form upload to OSS from a web client, see JavaScript client-side signature direct upload.
For common errors and troubleshooting methods when calling the PostObject operation, see Post Object Errors and Troubleshooting.