unable to upload files to aws s3 bucket shows ” A PHP Error was encountered Severity: User Warning
Message: S3::putObject(): [AccessDenied] Access Denied
Filename: libraries/S3.php”
PHP,HTML,CSS,JS,Wordpress,Blogger,Seo Tools,Domain,Hosting And Others Support
Error executing “PutObject” on “https://my-shop1.s3.ap-south-1.amazonaws.com/products/b63c7e59ff9c6040161f80e436eaabab.jpg“; AWS HTTP error: Client error: `PUT ▶
\n
AccessDenied
Access DeniedE5EA21 (truncated…)\n
AccessDenied (client): Access Denied – \n
AccessDenied
Access DeniedE5EA2109F158B3BEku8TuqbKq7fvjw5QenbrNDJx+beRZcqlEtLZICkHQEwgCJAqZ/l/qG6QV4RP+MODCFd80da0v9g=
unable to upload files to aws s3 bucket shows ” A PHP Error was encountered Severity: User Warning
Message: S3::putObject(): [AccessDenied] Access Denied
Filename: libraries/S3.php”
This error comes due to a mistake, it comes if you do not add aws s3 bucket policy when you create buckets.
Policy Code
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::Bucket-Name",
"arn:aws:s3:::Bucket-Name/*"
]
}
]
}