PHP code example of uam / propel-s3object-behavior
1. Go to this page and download the library: Download uam/propel-s3object-behavior 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/ */
uam / propel-s3object-behavior example snippets
$s3 = Aws::factory('/path/to/config.php')->get('s3');
$bucket = 'my-bucket';
$region = 'eu-west-1'; // Any AWS region
$serverSideEncryption = false; // No need to encrypt the documents on S3
$reducedRedundancyStorage = true; // Use reduced redundancy storage
$manager = new BasicS3ObjectManager(
$s3,
$bucket,
$region,
$serverSideEncryption,
$reducedRedundancyStorage
);
$document = DocumentQuery::create()
->findPk($id);
$document->setS3ObjectManager($manager);
$url = $document->getPresignedUrl("+5minutes");