Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

AWS SDK for PHP

Installation

Create a file named `list.php` with the following contents (substituting `mybucket` and `/path/to/aws-autoloader.php` with your information):

<?php
  require '/path/to/aws-autoloader.php';
  use Aws\S3\S3Client;

  use Aws\Exception\AwsException;
  $s3 = new Aws\S3\S3Client([
    'version' => 'latest',
    'region' => 'us-east-1',
    'endpoint' => 'https://polycloud.crowdapis.com',
  ]);

  $result = $s3->listObjects([
    'Bucket' => 'mybucket',
  ]);

  foreach ($result['Contents'] as $obj) {
      echo $obj['Key'] . "\n";
  }
?>

Run the example:

$ AWS_ACCESS_KEY_ID=<your access key> AWS_SECRET_ACCESS_KEY=<your secret> php list.p