All Products
Search
Document Center

Object Storage Service:0006-00000224

Last Updated:Jul 21, 2023

Problem description

A field type specified in conditions in the policy form field of a PostObject request is invalid.

Causes

You initiate a PostObject request to upload an object. However, a field type that is specified in conditions in the policy form field of the request body is invalid. As a result, a request error occurs.

Examples

The following sample code provides an example of the filters in the conditions field. In this example, ["not-in", "cache-control", "no-cache"] is specified. The "not-in" filter requires that the "no-cache" filter must be of the List type. However, the "no-cache" filter is of the String type. As a result, a request error occurs.

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
      	["not-in", "cache-control", "no-cache"]
    ]
}

Solutions

Make sure that filters in the conditions field are of valid data types. The following sample code provides an example of the filters in the conditions field:

{
    "expiration": "2023-02-19T13:19:00.000Z",
		"conditions": [    
        ["content-length-range", 1, 1024],
        ["eq", "$success_action_status", "201"],
        ["starts-with", "$key", "user/eric/"],
        ["in", "$content-type", ["image/jpg", "image/png"]],
        ["not-in", "$cache-control", ["no-cache"]]
  	]
}

References