PHP code example of 99designs / facade

1. Go to this page and download the library: Download 99designs/facade library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

99designs / facade example snippets




$s3 = new Facade_S3(getenv('AWS_ACCESS_KEY_ID'), getenv('AWS_SECRET_ACCESS_KEY'));
$file = '/uploads/largeimage.jpg';

$response = $s3
	->put("/llamas/largeimage.jpg")
	->setStream(Facade_Stream::fromFile($file))
	->setContentType('image/jpeg')
	->setHeader('Content-MD5: '.base64_encode(md5_file($file, true)))
	->send();




$s3 = new Facade_S3(getenv('AWS_ACCESS_KEY_ID'), getenv('AWS_SECRET_ACCESS_KEY'));

$response = $s3
  ->get('/llamas/largeimage.jpg')
  ->send();

stream_copy_to_stream($response->getStream(), STDOUT);