lundi 5 janvier 2015

Unable to parse response body into XML: String could not be parsed as XML (View:

I have been tasked with connecting to an s3 bucket and using documentation have the following:



<?php
define('AWS_KEY', 'key in here');
define('AWS_SECRET_KEY', 'key in here');
define('HOST', 'http://ift.tt/1fjaobU');




use Aws\S3\S3Client;

// Establish connection with DreamObjects with an S3 client.
$client = S3Client::factory(array(
'base_url' => HOST,
'key' => AWS_KEY,
'secret' => AWS_SECRET_KEY
));

// list owned buckets


$blist = $client->listBuckets();
echo " Buckets belonging to " . $blist['Owner']['ID'] . ":\n";
foreach ($blist['Buckets'] as $b) {
echo "{$b['Name']}\t{$b['CreationDate']}\n";
}

// list Bucket contents


$o_iter = $client->getIterator('ListObjects', array(
'Bucket' => $bucketname
));
foreach ($o_iter as $o) {
echo "{$o['Key']}\t{$o['Size']}\t{$o['LastModified']}\n";
}


but I get the error in the title any ideas I have my access keys but i am confused about how to fix this issue ?





Aucun commentaire:

Enregistrer un commentaire