0
  • First Download Zip:
    https://github.com/aws/aws-sdk-php
  • Next Make onnection

    require get_stylesheet_directory() .'/aws/aws-autoloader.php';
      define('AWS_KEY', 'XXXXXXX');
      define('AWS_SECRET_KEY', 'XXXXXXXXXXXXXXXXXXXXXXX');
      $credentials = new Aws\Credentials\Credentials(AWS_KEY, AWS_SECRET_KEY);
      $s3 = new Aws\S3\S3Client([
          'version'     => 'latest',
          'region'      => REGION,
          'credentials' => $credentials
      ]);
      $result = $s3->listBuckets();
      $object = 'AutoPlotter/AutoPlotter.zip';
      $secret_plans_cmd = $s3->getCommand('GetObject', ['Bucket' => 'bucket-software', 'Key' => $object]);
      $request = $s3->createPresignedRequest($secret_plans_cmd, '+2 minute');
      echo $request->getUri();

Jagdish Sarma Asked question November 19, 2021
Add a Comment