PHP code example of dbp / relay-blob-library

1. Go to this page and download the library: Download dbp/relay-blob-library 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/ */

    

dbp / relay-blob-library example snippets


    // create the API
    $blobApi = BlobApi::createHttpModeApi(
        $bucketIdentifier, $bucketKey, $blobBaseUrl,
        $oidcEnabled, $oidcProviderUrl, $oidcClientId, $oidcClientSecret);

    $blobFile = new BlobFile();
    $filePath = 'files/myFile.txt';
    $blobFile->setFilename(basename($filePath));
    $blobFile->setFile(new SplFileInfo($filePath));
    $blobFile->setPrefix('my-prefix');
    
    // add the file    
    $blobFile = $blobApi->addFile($blobFile);

    // get the file
    $blobFile = $blobApi->getFile($blobFile->getIdentifier());

    // remove the file
    $blobApi->removeFile($blobFile->getIdentifier());