PHP code example of swarnat / wp-s3-offload

1. Go to this page and download the library: Download swarnat/wp-s3-offload 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/ */

    

swarnat / wp-s3-offload example snippets


// your access key
define('WPS3_KEY', '123...abc');
// your secret key to access bucket
define('WPS3_SECRET', '123...abc');

// name of the bucket, you want to connect to
define('WPS3_BUCKET', 'bucketname');
// region of bucket
define('WPS3_REGION', 'de-de');
// The folder within bucket to store files into
define('WPS3_FOLDER', '/');
// Should S3 access use pathstyle urls
define('WPS3_PATHSTYLE', true);

// URL to access the uploaded assets
define('WPS3_URL_PREFIX', 'https://s3.company.com/bucketname/');
// Define a custom URL endpoint
define('WPS3_ENDPOINT', 'https://s3.company.com');