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

This package is auto-updated.

Last update: 2024-04-23 16:00:34 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);