123456789101112131415161718192021222324252627282930 |
- <?php
- use Aws\S3\S3Client;
- use League\Flysystem\AwsS3v3\AwsS3Adapter;
- use League\Flysystem\Filesystem;
- include __DIR__ . '/vendor/autoload.php';
- $client = new S3Client([
- 'credentials' => [
- 'key' => 'iksop',
- 'secret' => '8htoiwn44g204th' ],
- 'endpoint' => 'https://s3.infra.flowdat.com/minio/login',
- 'use_path_style_endpoint' => true,
- 'region' => 'sa-east-1',
- 'version' => 'latest',]);
- $adapter = new AwsS3Adapter($client, 'comparaciones');
- $filesystem = new Filesystem($adapter);
- $path = $_GET["path"];
- if($filesystem->has($path)){
- header("Content-type:". $filesystem->getMimetype($path));
- $strm = $filesystem->readStream($path);
- echo stream_get_contents($strm);
- }
|