我可以限制通过JavaScript API放入S3的对象的大小吗? [英] Can I limit the size of an object put into S3 via the JavaScript API?

查看:65
本文介绍了我可以限制通过JavaScript API放入S3的对象的大小吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用JavaScript API将对象上载到S3,并且可以使用IAM策略获得精细的授权.例如,请参阅以下政策:

It is possible to use JavaScript APIs to upload objects to S3 and it is possible to have a fine-grain authorization using IAM policies. For instance, see this policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "s3:PutObject",
        "s3:PutObjectAcl"
      ],
      "Resource": [
        "arn:aws:s3:::YOUR_BUCKET_NAME/*"
      ],
      "Effect": "Allow"
    },
  ]
}

受其教程的启发,将对象放入存储桶YOUR_BUCKET_NAME中.但是,我不清楚是否可以限制对象的数量以及可以上传的每个对象的大小.我已经检查了

inspired from their tutorial which allows to put objects into the bucket YOUR_BUCKET_NAME. However it is not clear to me whether it is possible to limit the number of objects and the size of each objects one can upload. I have checked into the list of contitions, but I didn't find anything useful on this.

推荐答案

我认为这是3个问题:

  1. 是否可以使用JavaScript API将对象上传到S3? (是)
  2. 是否可以使用IAM策略获得精细的授权? (是)
  3. 是否可以限制对象的数量以及可以上传的每个对象的大小. (不会,至少不会通过任何类型的存储桶策略,或者未将此类限制编码到您的JS客户端或代理您上传的服务器中)

请参见 JS示例讨论政策 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆