Problem description
The expiration field in the Post Policy is invalid.
Causes
When you submit a PostObject request using form upload, OSS validates the policy document attached to the request. The expiration field must be a string in ISO 8601 GMT format. Passing a numeric value (such as an integer) causes this error.
Examples
The following example shows an invalid policy document where expiration is set to a numeric value instead of an ISO 8601 string:
{
"expiration": 123,
"conditions": [
["content-length-range", 0, 1048576000]
]
}Solutions
Set expiration to a valid ISO 8601 GMT datetime string.
Valid `expiration` value:
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000]
]
}References
For the full policy document specification, see Appendix: Policy.
To implement browser-based uploads with signed policies, see Add signatures on the client by using JavaScript and upload data to OSS.
For other PostObject errors and fixes, see Errors and troubleshooting methods of PostObject.