Sachin Singh February 2016

Upload file from url to AWS in laravel

I know how to upload file from local storage to aws using laravel. But I want to upload file directly from external url to aws without downloading.

Any suggestion, how can I achieve this.

Answers


Sachin Singh February 2016

I finally solved this using Image Library.

use Image;
use Storage;


$image = Image::make('url');
$image->encode('jpg');
$s3 = Storage::disk('s3');
$filePath = '/profilePhotos/'.$time();
$s3->put($filePath, $image->__toString(), 'public');

Post Status

Asked in February 2016
Viewed 1,215 times
Voted 11
Answered 1 times

Search




Leave an answer