How do you make S3 Object public via Java SDK?

0 votes

How do you make an S3 object public via the AWS Java SDK?

Specifically, what API methods via the Java AWS SDK can be used to make an Object public when it's uploaded?

Oct 16, 2018 in AWS by datageek
• 2,460 points
898 views

1 answer to this question.

0 votes

Found the answer in an AWS Documentation

return s3Client.putObject(
   new PutObjectRequest(bucketName, objectKey, inputStream, metadata)
      .withCannedAcl(CannedAccessControlList.PublicRead));

The answer being

.withCannedAcl(CannedAccessControlList.PublicRead)

answered Oct 16, 2018 by Archana
• 4,150 points

Related Questions In AWS

0 votes
1 answer

How do I write an S3 Object to a file?

While IOUtils.copy() and IOUtils.copyLarge() are great, I would prefer the old ...READ MORE

answered Jul 13, 2018 in AWS by Hammer
• 360 points
842 views
0 votes
1 answer

How to make a S3 bucket public?

You can change the setting according to ...READ MORE

answered Feb 13, 2019 in AWS by Priyaj
• 57,550 points
99 views
0 votes
1 answer

How to make a S3 bucket public?

create a bucket policy with the following ...READ MORE

answered Mar 12, 2019 in AWS by Reena
98 views
+4 votes
5 answers

Usage of Amazon Cloudfront or S3

When to use S3? S3 is like many ...READ MORE

answered Apr 3, 2018 in AWS by brat_1
• 7,170 points
260 views
+3 votes
6 answers

Renaming files in S3

You can either use AWS CLI or ...READ MORE

answered Oct 16, 2018 in AWS by petter dj
5,012 views
0 votes
1 answer

S3 Static Website Hosting Route All Paths to Index.html

Yes there is an easy way to ...READ MORE

answered Apr 8, 2018 in AWS by code_ninja
• 6,230 points
1,356 views
+1 vote
4 answers

Can a URL be directly uploaded to S3 using POST?

You can read this blog and get ...READ MORE

answered Oct 25, 2018 in AWS by chamunda
207 views
0 votes
1 answer

How do you concatenate small sized files in Amazon S3?

Amazon S3 does not provide a concatenate ...READ MORE

answered Sep 3, 2018 in AWS by Archana
• 4,150 points
2,302 views
0 votes
1 answer

How to make multiple files in Amazon S3 public?

I had to change several hundred thousand ...READ MORE

answered Oct 17, 2018 in AWS by Archana
• 4,150 points
126 views