A simple PHP application illustrating how to use simple storage service of the AWS SDK for PHP.
A composer.json file declaring the dependency on the AWS SDK is provided. To
install Composer and the SDK, run:
curl -sS https://getcomposer.org/installer | php
php composer.phar install
You need to set up your AWS security credentials before the sample code is able to connect to AWS. Then open up sample.php and add your AWS access key and secret.
$credentials = new Credentials('YOUR_AWS_ACCESS_KEY_ID', 'YOUR_AWS_SECRET_KEY');
Then add bucket name if not created. Script will automatically create bucket with that name for you.
$bucket='your name of bucket';
See the Security Credentials page for more information on getting your keys. You can also set your credentials in a couple of other ways. See the AWS SDK for PHP documentation for more information.
Just run index.php from your localhost and upload file! Thats it!
The S3 documentation has a good overview of the restrictions for bucket names for when you start making your own buckets.
This sample application is distributed under the Apache License, Version 2.0.