Simple way for uploading file to Amazon S3

I have one project for uploading video file to Amazon S3 server on PHP environment.

To get started with sample, download sample project.

git clone

Go to aws-php-sample folder and run. This will install composer.

curl -sS | php
php composer.phar install


Create testing php script.

require 'vendor/autoload.php';

use Aws\Exception\AwsException;
use Aws\S3\Exception\S3Exception;

$s3 = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'debug' => false

$bucket = 'test-bucket';
$key = 'test.mp4';
$result = $s3->putObject([
'Bucket' => $bucket,
'Key' => $key,
'SourceFile' => '/home/titus/test/aws-php-sample/test.mp4',


Run sample from the url or command:

php test.php

If it is not working, change debug value as true. Then you can see what the problem is.

Simple is beautiful as always.