Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 将文件上载到amazon web服务器_Amazon Web Services_Amazon S3 - Fatal编程技术网

Amazon web services 将文件上载到amazon web服务器

Amazon web services 将文件上载到amazon web服务器,amazon-web-services,amazon-s3,Amazon Web Services,Amazon S3,我正在尝试使用amazon web服务上载文件,但出现如下错误,因为文件未上载到服务器: { "data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Invalid according to Policy: Policy Condition failed: [\"starts-with\",

我正在尝试使用amazon web服务上载文件,但出现如下错误,因为文件未上载到服务器:

    {
    "data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Invalid according to Policy: Policy Condition failed: [\"starts-with\", \"$filename\", \"\"]</Message><RequestId>7A20103396D365B2</RequestId><HostId>xxxxxxxxxxxxxxxxxxxxx</HostId></Error>",
    "status": 403,
    "config": {
        "method": "POST",
        "transformRequest": [null],
        "transformResponse": [null],
        "url": "https://giblib-verification.s3.amazonaws.com/",
        "data": {
            "key": "@usc.edu/1466552912155.jpg",
            "AWSAccessKeyId": "xxxxxxxxxxxxxxxxx",
            "acl": "private",
            "policy": "xxxxxxxxxxxxxxxxxxxxxxx",
            "signature": "xxxxxxxxxxxxxxxxxxxx",
            "Content-Type": "image/jpeg",
            "file": "file:///storage/emulated/0/Android/data/com.ionicframework.giblibion719511/cache/1466552912155.jpg"
        },
        "_isDigested": true,
        "_chunkSize": null,
        "headers": {
            "Accept": "application/json, text/plain, ​*/*​"
        },
        "_deferred": {
            "promise": {}
        }
    },
    "statusText": "Forbidden"
}

有谁能告诉我403被禁止回应的原因是什么?提前感谢

您需要提供更多详细信息。您正在使用哪个客户机?从外观上看,有一个明确拒绝此上载的策略。

看起来您的用户对该特定S3存储桶没有适当的权限。使用AWS控制台IAM分配适当的权限,包括写入权限


更重要的是立即使密钥/秘密对无效,并重命名存储桶绝不在开放网站上共享实际密钥和密码。在您阅读本文时,可能已有人正在使用您的凭据

读取错误:
根据策略无效:策略条件失败:[\“以\“,\“$filename\,\”\“\”]

您的策略文档对您未满足的上载施加了限制,而S3实际上拒绝了上载,因为您告诉了它


没有理由在您签署的保单文档中包含此条件。根据文档,这意味着您需要一个名为
filename
的表单字段,该字段不能为空。但是没有这样的表单字段。从您的策略中删除此项,上载应该会起作用。

慢一点<代码>AWSAccessKeyId不是敏感数据。无论是签名还是保单。在我看到的帖子中没有任何敏感内容,甚至在它被编辑之前。这是一个标准表单post上传,设计为在网站的HTML中可见,也可以是公共的。