jumichica / aws-s3-api
Api to integrate PHP with S3 and save files on Amazon AWS.
1.0.3
2023-05-23 13:47 UTC
Requires
- php: >=7.4
- aws/aws-sdk-php: ^3.270.0
- nyholm/psr7: ^1.8.0
This package is auto-updated.
Last update: 2025-03-23 17:54:06 UTC
README
Simplify the AWS S3 interactions.
Use the example 1 to start wwith this library:
<?php
#Ejemplo para subir un archivo con permisos públicos
require(__DIR__.'/../vendor/autoload.php');
use s3_api\S3Api;
$s3=new S3Api();
$api = '[API_KEY]';
$region = '[REGION]';
$secret = '[SECRET]';
$file = 'prueba.txt';
$bucket = '[BUCKET]';
$file_path = '[FILE_PATH]';
$s3->connect($api,$secret, $region);
$s3->connect($api,$secret, $region);
// UPLOAD A FILE FROM LOCAL TO BUCKET
$s3->upload($bucket, $file, $file_path);
// DOWNLOAD FROM BUCKET TO LOCAL
$s3->download($bucket, $file, $file_path);