Reputation: 153
I wonder if anyone can help. I'm currently working on a project where we have a load of pdf documents in an S3 bucket. What i would like to be able to do is to open the link to each pdf automatically, however the link to each document is:
but this doesn't open straight into a pdf reader as the link is s3://
This is how we have the pdf files in the folder in the S3 bucket:
This what each individual pdf property in S3 looks like:
if i click the Object URL link in the property section i get the following:
Is there something I need to change in the S3 bucket policy to get this to work? Any help or guidance would be greatly appreciated.
Upvotes: 0
Views: 3892
Reputation: 81
It seems like you want a public S3 bucket (if fully public is not what you want, see the link towards the end). In order to make all objects public you must:
getObject
requestsYour bucket policy should look something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
After you do this, you should see the 'Publicly accessible' flags on your bucket and you'll be able to access objects with the object URL.
This article goes into more depth on object access.
Upvotes: 3