PHP code example of sistemi-etime / flysystem-plugin-aws-s3-v3
1. Go to this page and download the library: Download sistemi-etime/flysystem-plugin-aws-s3-v3 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/ */
sistemi-etime / flysystem-plugin-aws-s3-v3 example snippets
use Etime\Flysystem\Plugin\AWS_S3 as AWS_S3_Plugin;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;
use Aws\S3\S3Client;
$client = new S3Client([
'credentials' => [
'key' => 'your-key',
'secret' => 'your-secret'
],
'region' => 'your-region',
'version' => 'latest|version',
]);
$adapter = new AwsS3Adapter($client, 'your-bucket-name');
$filesystem = new Filesystem($adapter);
$filesystem->addPlugin(new AWS_S3_Plugin\PresignedUrl());
$success = $filesystem->getPresignedUrl('/tmp/some/target');