All Products
Search
Document Center

Object Storage Service:0006-00000223

Last Updated:Jul 21, 2023

Problem description

An invalid value is specified for a condition that is specified by the conditions parameter in the policy form field of the PostObject request.

Causes

You initiated a PostObject request to upload an object. However, the content-length-range condition that is specified by the conditions parameter in the policy form field is set to a string. As a result, a JSON parsing error is returned. The content-length-range condition must be set to a positive integer.

Examples

The error is returned because max-len in the content-length-range condition that is specified by the conditions parameter in the policy form field is set to test.

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
      	["content-length-range", [1], "test"]
    ]
}

Solutions

The content-length-range condition specifies the maximum size and minimum size of the object that you can upload. Make sure that the value of the condition is in the following format: ["content-length-range", min-len, max-len]. max-len specifies the maximum size of the object that you can upload in bytes and min-len specifies the minimum size of the object that you can upload in bytes. Make sure that the values of max-len and min-len are positive integers and the value of max-len is greater than or equal to the value of min-len.

{
    "expiration": "2023-02-19T13:19:00.000Z",
		"conditions": [    
        ["content-length-range", 1, 1024]
  ]
}

References