Problem description
A PostObject request fails because the policy form field is missing the required expiration field.
Causes
The policy form field in a PostObject request must always contain both the expiration and conditions fields. If either field is absent, OSS rejects the request with an error.
Examples
The following policy is missing the expiration field and causes the error:
{
"conditions": [
["content-length-range", 0, 1048576000]
]
}Solutions
Add the expiration field to the policy JSON. The expiration field specifies when the policy expires, in ISO 8601 GMT format. For example, 2023-02-19T13:19:00.000Z means the policy is no longer valid after 13:19:00 UTC on February 19, 2023. Set this value far enough in the future to cover your upload window.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000]
]
}References
For details about the
policyform field structure, see the "Appendix: Policy" section in PostObject.To learn how to upload data from a web client to Object Storage Service (OSS) using form upload, see Add signatures on the client by using JavaScript and upload data to OSS.
For common PostObject errors and how to resolve them, see PostObject.