Reputation: 1
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"
Upvotes: 0
Views: 1086
Reputation: 315
There are two ways to solve this problem-
Uncheck
- Block new public ACLs and uploading public object
- Remove public access granted through public ACLs
Now try to upload, I hope it will work.
Use "S3::ACL_PRIVATE" in your putObjectFile function parameter at the time of upload file. ACL_PRIVATE and other keys are declared in the s3.php library file.
$saved = $this->s3->putObjectFile($file_path,
$this->bucket_name,
$this->folder_name.$s3_file,
S3::ACL_PRIVATE,
array(),
$mime_type);
Now try to upload.
Upvotes: 1