Skip to content

Instantly share code, notes, and snippets.

@neilmaledev
Last active April 7, 2017 16:56
Show Gist options
  • Select an option

  • Save neilmaledev/d255c42f1289a9ab9394121b7896d4d3 to your computer and use it in GitHub Desktop.

Select an option

Save neilmaledev/d255c42f1289a9ab9394121b7896d4d3 to your computer and use it in GitHub Desktop.
use S3;
===========================
//depends on your credentials
$AWS = [
'key'=> 'youS3Key',
'secret' => 'imBatman',
'bucket' => 'bucketNameHere'];
new S3($AWS['key'], $AWS['secret']);
$url = file_get_contents("https://b.fastcompany.net/multisite_files/fastcompany/imagecache/inline-small/inline/2015/09/3050613-inline-i-2-googles-new-logo-copy.png");
$customName = "upload/result.png";
//this is what u're looking for
S3::putObjectString($url, $AWS['bucket'], $customName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment