Problem description
The required expiration field is missing in the policy form field in a PostObject request.
Causes
You initiate a PostObject request to upload an object. However, the required expiration field is missing in the policy form field in the request. As a result, a request error is reported.
Examples
The following sample code provides an example of the policy form field in the JSON format. In this example, the required expiration field is missing.
{
"conditions": [
["content-length-range", 0, 1048576000]
]
}
Solutions
Make sure that the policy form field in the JSON format contains both the expiration and conditions fields.
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000]
]
}
References
-
For more information about the policy form field, see the "Appendix: Policy" section of the PostObject topic.
-
For more information about how to transfer data from a web client to Object Storage Service (OSS) by using form upload, see Add signatures on the client by using JavaScript and upload data to OSS.
-
For more information about common errors and troubleshooting methods of the PostObject operation, see PostObject.