Working with the Amazon S3 service is pretty easy if you understand the basic concepts of S3 and are using one of the AWS-provided SDKs, like the AWS SDK for PHP. This presentation and corresponding demo code will show you how it's done.
« S3 Upload Demo »
I’m Jeremy Lindblom
Software Architect at McGraw-Hill Education
@jeremeamia on Twitter and GitHub
Uploading to S3 from PHP
We will use the AWS SDK for PHP to
upload a file to S3 also dive into the details
about S3, AWS, the SDK, & Guzzle
Tell me about
“all the things”!
A blob storage cloud-based
service provided by AWS. First
released in 2006. Very popular,
and has tons of features.
A service for storing and
retrieving “blob”s, or “object”s,
which are essentially chunks of
text or binary data. We typically
call these “files” locally.
Amazon Web Services. A large
suite of web services and APIs for
manipulating data and
infrastructure in Amazon’s cloud.
AWS SDK for PHP
An AWS-supported PHP library
for interacting AWS’s services
and APIs. It is built on Guzzle.
A popular HTTP client library for
PHP that implements PSR-7 and
middleware, and provides an
abstraction layer over cURL.
A PSR (PHP Standards
Recommendation) created by the
PHP-FIG to define standard
interfaces for HTTP Request and
AWS Has a BIG Problem
Hint: It’s not their competition.
different services spread across 18+ categories
Many of their services
build on each other
- Is “private” by default
- Set to “public-read” for public access
Keys & Prefixes
◇ region: The AWS region (e.g., us-east-1, us-west-2)
◇ bucket: Your bucket name (they are globally unique)
◇ key: Path to the specific object in the bucket
A prefix is the first part of a path key. Usually used to
represent a “directory” (e.g., foo/bar/baz.json). When you
list objects, you list them by a prefix.
“ Performance scales per prefix, so you
can use as many prefixes as you need
in parallel to achieve the required
throughput. There are no limits to the
number of prefixes.
Let’s Look at Some Code!
We will look at four ways that an upload to S3 can be performed in
a PHP application using the AWS SDK for PHP and other libraries.
Place your screenshot here
The Four Ways
◇ Superglobals + AWS SDK
◇ PSR-7 + AWS SDK
◇ PSR-7 + Flysystem
◇ PSR-7 + PostObject
You can find me at:
◇ [email protected]
◇ Presentation template by SlidesCarnival