Your url will look like this: https://s3.amazonaws.com/BUCKET_NAME/IMAGE_NAME.jpg
Amazon S3 files: get full url of file uploaded and set permissions to public
Hi all,
Im working with an Amazon S3 bucket. The upload functionality is working fine.
But I dont know how to do a simple thing like show an image uploaded to the Amazon S3 bucket.
How can I get the link to the image?
Also, I dont know how to set the permissions of the file to public. By default only the owner can see the image.
Thanks!
Ok, I finally fix the error.
The problem was in the Amazon S3 bucket configuration.
In the Bucket Policy Editor I added this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::my_bucket_name/*"
]
}
]
}
And now is working :)
More info: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html
Thanks @jakeryansmith for your help.
Please or to participate in this conversation.