我正在尝试在从网页帖子上传时指定 AWS S3 对象(图像文件)的存储类。在没有存储类规范的情况下一切正常,但是当我将其添加到策略时,页面重定向到带有 XML 的错误页面,该页面指示:
Invalid according to Policy: Policy Condition failed: ["eq", "$x-amz-storage-class", "STANDARD_IA"]
我为存储类尝试了不同的值,例如大写/小写、STANDARD、STANDARD-IA 等,但似乎没有任何效果。任何帮助,将不胜感激。
这是编码前的对象策略:
{
"expiration": "2040-01-01T00:00:00Z",
"conditions": [
{"bucket": "dev-image"},
["starts-with", "$key", ""],
{"acl": "private"},
{"success_action_redirect": "http://localhost/Image.jsp"},
["starts-with", "$Content-Type", ""],
{"x-amz-storage-class": "STANDARD_IA"}, <<<<< Causes Problem
["content-length-range", 0, 10485760]
]
}