Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permissions on files uploaded using AWS iOS SDK 2.0

I'm uploading files to an S3 bucket using a method based on the AWS example code here:

http://docs.aws.amazon.com/mobile/sdkforios/developerguide/s3transfermanager.html

The problem is, once those files are uploaded, the default permission to view those files is only given to the owner of the S3 bucket, and I would like them to be publicly available. How can I achieve this using the iOS SDK 2.0?

like image 818
sak Avatar asked Sep 11 '14 11:09

sak


People also ask

Why am I getting an HTTP 403 Forbidden error when I try to upload files using the Amazon S3 console?

The "403 Forbidden" error can occur due to the following reasons: Permissions are missing for s3:PutObject to add an object or s3:PutObjectAcl to modify the object's ACL. You don't have permission to use an AWS Key Management Service (AWS KMS) key. There is an explicit deny statement in the bucket policy.

Why am I getting an access denied error message when I upload files to my Amazon S3 bucket?

If you're getting Access Denied errors on public read requests that are allowed, check the bucket's Amazon S3 Block Public Access settings. Review the S3 Block Public Access settings at both the account and bucket level. These settings can override permissions that allow public read access.


1 Answers

You can assign AWSS3ObjectCannedACLPublicRead to the ACL property on your AWSS3PutObjectRequest object.

like image 160
Yosuke Matsuda Avatar answered Oct 13 '22 19:10

Yosuke Matsuda