简体   繁体   中英

amazon s3 bucket image access denide

i am try to access uploaded images URL all time but image link expire after some time and show error " AccessDenied "

i have also make bucket policy public

{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPublicRead", "Effect": "Allow", "Principal": { "AWS": " " }, "Action": "s3:GetObject", enter code here "Resource": "arn:aws:s3:::projectname/foldername/ " } ] }

Write TransferObserver like below,

This is java code (not kotlin )

  TransferObserver uploadObserver =
                        transferUtility.upload(yourBucketName, key, file, CannedAccessControlList.PublicRead);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM