文档

0006-00000222

更新时间:

问题描述

Post Policy中conditions中存在类型不是Map或者List的项。

问题原因

您发起了PostObject请求来上传文件,但是请求中Post Policy表单域的conditions中某一项的类型不是Map或者List,导致请求报错。

问题示例

以下示例中conditions中的第一项为123,与接口要求的必须为Map类型或者List类型不相符。

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

解决方案

确保Post Policy中conditions列表下的每一项都是一个限定条件,且必须是Map类型或者List类型。

{
    "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"]]
  	]
}

相关文档