I am using amazon-php-sdk. In my application I'm accepting key and secret value from a form and passing for connecting to Aws. Here is my code.
<?php
require 'aws-autoloader.php';
use Aws\S3\S3Client;
try {
$s3Client = S3Client::factory(array(
'key' => 'my key',
'secret' => 'my secret key'
));
}
catch(S3Exception $e) {
echo 'Msg' . $e->getMessage();
}
?>
- How do I check whether the connection is success or not ?
- How can I check the already created object using the passed key so I that I don't want to create the object again. I need to create the object only if the passed key is different from the already created one.