Problem description
The content-length-range condition in the PostObject policy contains an invalid value.
Causes
When you submit a PostObject request, OSS validates the content-length-range condition in the conditions field of the policy form field. This condition sets the minimum and maximum allowed sizes for the uploaded object and must follow this format:
["content-length-range", min-len, max-len]Both min-len and max-len must be positive integers, and max-len must be greater than or equal to min-len. Otherwise, an error is returned.
Examples
The following policy is invalid because max-len is set to "test" instead of a positive integer:
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 10, "test"]
]
}Solutions
Set both min-len and max-len to positive integers, with max-len greater than or equal to min-len:
{
"expiration": "2023-02-19T13:19:00.000Z",
"conditions": [
["content-length-range", 1, 1024]
]
}References
For the full policy form field specification, see Appendix: Policy.
To upload data from a web client using form upload, see Add signatures on the client by using JavaScript and upload data to OSS.
For other PostObject errors, see Errors and troubleshooting methods of PostObject.