use Aws\\S3\\Exception\\S3Exception;
// Load SDK by requiring from your composer vendor directory
require 'vendor/autoload.php';
// use the following code to use filebase credentials.
$raw_credentials = array(
'key' => 'filebase-access-key',
'secret' => 'filebase-secret-key'
'endpoint' => 'https://s3.filebase.com',
'use_path_style_endpoint' => true
//use the following code to establish a connection to Filebase via access and secret keys.
$s3 = S3Client::factory($raw_credentials);
$bucket = "filebase-bucket";
$file_Path = "/path/to/object";
$result = $s3->putObject([
'SourceFile' => $file_Path]);
} catch (S3Exception $e) {
echo $e->getMessage() . PHP_EOL;