2017 © Pedro Peláez
 

library upload-aws

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

image

jdavidbakr/upload-aws

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  • Saturday, January 30, 2016
  • by jdavidbakr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 775 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

UploadAWS

Latest Version on Packagist ![Software License][ico-license] Total Downloads, (*1)

A wrapper class to handle images and uploading them to AWS. Features such as resizing, cropping, etc are included. A random remote filename is generated, if you want to retain the original filename you should do so in the database. This is to prevent file name collisions remotely; the class passes back the random remote filename., (*2)

Requires the PHP-GD library., (*3)

This should work outside of Laravel but I built it for Laravel, so your mileage may vary., (*4)

To process an uploaded file:, (*5)

// Instantiate with the $_FILE array.
// Uses config('aws.bucket') or you can pass the bucket as the second argument of the constructor.
$upload = new \jdavidbakr\UploadAWS($_FILE['form_name']);

// Retrieve the location of the uploaded file and store it somewhere
$location = $upload->get_location();

To work with a file that has been uploaded:, (*6)

// Instantiate with the remote file path
$upload = new \jdavidbakr\UploadAWS($location);

Once you have a file, you can perform several operations on it, especially if it's an image file:, (*7)

// Get a temporary signed URL
$url = $upload->get_url();
// Resize the image
$upload->resize_image(640,480);
// Resize the image so that it fits in the max size
$upload->get_max_size(1000,1000);
// Scale image, applies pillarbox or letterbox to retain the aspect ratio
$upload->scale_image(640,480);
// Crop the image to this size, will retain the current image center
$upolad->crop_image(640,480);
// Crop the image with full control over what part of the image to keep
$upload->crop($top, $left, $width, $height);
// Copy the image into a new file location
$upload->copy();
// Delete the remote file
$upload->delete();
// Get the actual size of the file
$upload->get_file_size();

The Versions

30/01 2016

dev-master

9999999-dev

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

MIT

The Requires

 

08/01 2016

1.0.4

1.0.4.0

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

MIT

The Requires

 

08/01 2016

1.0.2b

1.0.2.0-beta

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

MIT

The Requires

 

08/01 2016

1.0.3

1.0.3.0

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

MIT

The Requires

 

04/11 2015

1.0.2

1.0.2.0

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

MIT

The Requires

 

05/08 2015

1.0.1

1.0.1.0

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

The Requires

 

04/08 2015

1.0

1.0.0.0

A service that manages file uploads and sends them to AWS. Utilities include several image processing functions.

  Sources   Download

The Requires