I am facing problem while uploading any file on S3 Server. but the same configuration is working on a different project. No concept changed and no any configuration changed. I am working on Laravel 5.8 version. I am sharing code and Error please tell me why it is coming?
Error
Error executing "PutObject" on "https://coxxxxx.s3.ap-south-1.amazonaws.com/uploadFiles/pdf/2222222/2222222_COLLEGE_DETAILS_1569831261.pdf"; AWS HTTP error: Client error:
PUT https://colxxxxx.s3.ap-south-1.amazonaws.com/uploadFiles/pdf/2222222/2222222_COLLEGE_DETAILS_1569831261.pdf
resulted in a403 Forbidden
AccessDenied
Access Denied3E7C4E (truncated...) AccessDenied (client): Access Denied -
FileSysrems.php
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL')
],
For Uplaod on S3
$s3Path ="uploadFiles/pdf/2222222/2222222_COLLEGE_DETAILS_1569831261.pdf";
$binary_data = base64_decode($file);
$pathS3 =Storage::disk('s3')->put($s3Path, $binary_data,'public');