Reputation: 701
I need to make my upload as public. I was able to upload a image into s3 bucket. But i was unable to make that public by programmatically I am using AWS SDK 2.1.10 Below is my code for uploading image into s3 bucket
mUpload = getTransferManager().upload( AmazonConstants.BUCKET_NAME.toLowerCase(Locale.US), /* getPrefix(getContext()) // "android_uploads/" */ locationPath + super.getFileName() /** + "." + mExtension */ , mFile);
mUpload.waitForCompletion();
Please help me. Thank you.
Upvotes: 1
Views: 1438
Reputation: 9050
You need to use PutObjectRequest
in upload()
.
getTransferManager().upload(
new PutObjectRequest(String bucketName, String key, File file)
.withCannedAcl(CannedAccessControlList.PublicRead)
);
Upvotes: 4