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
437 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
381 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,510 points
59 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
57 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,160 points
156 views
+3 votes
5 answers

Renaming files in S3

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

answered Oct 16, 2018 in AWS by petter dj
1,688 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
771 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
110 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
1,300 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
89 views