PHPackages                             eddturtle/direct-upload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. eddturtle/direct-upload

ActiveLibrary[File &amp; Storage](/categories/file-storage)

eddturtle/direct-upload
=======================

Composer Package to build an AWS Signature ready to Direct Upload to S3

v3.0.0(5y ago)88728.1k—4%26[1 issues](https://github.com/eddturtle/direct-upload/issues)[1 PRs](https://github.com/eddturtle/direct-upload/pulls)2MITPHPPHP &gt;=7.2

Since Feb 16Pushed 4y ago8 watchersCompare

[ Source](https://github.com/eddturtle/direct-upload)[ Packagist](https://packagist.org/packages/eddturtle/direct-upload)[ Fund](https://paypal.me/eddturtle)[ RSS](/packages/eddturtle-direct-upload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (22)Used By (2)

Direct Upload to S3 (using PHP)
===============================

[](#direct-upload-to-s3-using-php)

[![Build Status](https://camo.githubusercontent.com/0eca4cd3882beb92c57f8528b91c0c660b3b9d836a27b6b902eba6edbfa9a886/68747470733a2f2f7472617669732d63692e6f72672f656464747572746c652f6469726563742d75706c6f61642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/eddturtle/direct-upload)[![Latest Stable Version](https://camo.githubusercontent.com/af43f266b0604b123fecc3f1d72bdaeed7ae03ddaf19492ba99adf2ceea6076f/68747470733a2f2f706f7365722e707567782e6f72672f656464747572746c652f6469726563742d75706c6f61642f762f737461626c65)](https://packagist.org/packages/eddturtle/direct-upload)[![Total Downloads](https://camo.githubusercontent.com/edc90496405ae823f1fba565924fc48a3aff10023658eab37414924ec806ddb4/68747470733a2f2f706f7365722e707567782e6f72672f656464747572746c652f6469726563742d75706c6f61642f646f776e6c6f616473)](https://packagist.org/packages/eddturtle/direct-upload)[![License](https://camo.githubusercontent.com/1c2728ceeeb6cda0710a42f24aa13127aec6fa0aa11bd4c2118b3dcfc5f09881/68747470733a2f2f706f7365722e707567782e6f72672f656464747572746c652f6469726563742d75706c6f61642f6c6963656e7365)](https://packagist.org/packages/eddturtle/direct-upload)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c1e0a2740112e28033b02952c6d675bea59a89191f6fd1deeea58e23dff20847/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656464747572746c652f6469726563742d75706c6f61642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/eddturtle/direct-upload)

This package is designed to build the necessary AWS signature (v4), policy and form inputs for sending files directly to Amazon's S3 service. This is especially useful when uploading from cloud platforms and help to build '[twelve factor apps](http://12factor.net/backing-services)'.

This project was sprouted from [this blog post](https://www.designedbyaturtle.co.uk/2015/direct-upload-to-s3-using-aws-signature-v4-php/) which might help explain how the code works and how to set it up. The blog post also has lots of useful comments, which might help you out if you're having problems.

Supports PHP 7.2+ (if you need php 5.5+ use v1.\*)

### Install

[](#install)

This package can be installed using Composer by running:

```
composer require eddturtle/direct-upload

```

### Usage

[](#usage)

Once we have the package installed we can make our uploader object like so: (remember to add your S3 details)

Option 1: Specify AWS Credentials

```
