PHP code example of catlabinteractive / central-storage-client

1. Go to this page and download the library: Download catlabinteractive/central-storage-client 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/ */

    

catlabinteractive / central-storage-client example snippets


$client = new \CatLab\CentralStorage\Client\CentralStorageClient(
    'https://storage.example.com',
    $consumerKey,
    $consumerSecret
);

// Store a local file
$asset = $client->store('/tmp/upload-tmpfile', 'photo.jpg', [ 'publisher' => 1 ]);

echo $client->getAssetUrl($asset);

// Remove it again
$client->delete($asset);