Step 1 - I have added aws/aws-sdk-php by composer package , version : 3.297.3.
Step 2 - In server events -> global -> all pages -> added nameSpace_use -> use \Aws\S3\S3Client;
Step 3 - In server events -> global -> all pages -> Global Code -> added aws connection
putenv("AWS_ACCESS_KEY_ID=XXXXXXXXXXX");
putenv("AWS_SECRET_ACCESS_KEY=XXXXXXXXXXX");
putenv("AWS_CONFIG_FILE='/'");
$s3client = new S3Client([
"version" => "latest",
"region" => "XXXXX",
"AWS_BUCKET" => "XXXX",
"AWS_USE_PATH_STYLE_ENDPOINT" => false,
"http" => ["verify" => true]
]);
$s3client->registerStreamWrapper();
Step 4 - in advance setting option i have added
file-upload-path-absolute-for-temporary-files = temp
file-upload-url-path-absolute-for-temporary-files = (tried = /temp/
, http://localhost/my-project/temp
)
in php settings -> upload path -> i have added - s3://my-bucket/
and in field upload path is - s3://my-bucket/user/
now when i am uploading image in add page i got added successfully but image is not found in s3 bucket. Please help me