xxxxxxxxxx
public function uploadDirectory($directory, $bucket, $keyPrefix = null, array $options = array())
xxxxxxxxxx
// Upload an object by streaming the contents of a file
// $pathToFile should be absolute path to a file on disk
$result = $client->putObject(array(
'Bucket' => $bucket,
'Key' => 'data_from_file.txt',
'SourceFile' => $pathToFile,
'Metadata' => array(
'Foo' => 'abc',
'Baz' => '123'
)
));
// We can poll the object until it is accessible
$client->waitUntil('ObjectExists', array(
'Bucket' => $this->bucket,
'Key' => 'data_from_file.txt'
));