Skip to content Skip to sidebar Skip to footer

Can I Limit The Size Of An Object Put Into S3 Via The Javascript Api?

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: inspired fro

Solution 1:

Is it possible to limit the number of objects and the size of each object one can upload to S3? In general, no. You cannot do this through any kind of bucket policy.

You can, however, limit an individual object upload size from browsers using a pre-signed POST URL with a policy indicating a content-length-range.

Alternatively, you could code this restriction into your JS client or a server that proxies your uploads.

See JS examples and a discussion of policies and a related response on restricting object size via POST.

Solution 2:

In reply to the title "Can I limit the size of an object put into S3 via the JavaScript API?"

Yes you can. But instead of using IAM, use createPresignedPost. In Conditions specify a maximum content-length-range.

Post a Comment for "Can I Limit The Size Of An Object Put Into S3 Via The Javascript Api?"