PHP code example of medoid / backblaze-b2

1. Go to this page and download the library: Download medoid/backblaze-b2 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/ */

    

medoid / backblaze-b2 example snippets

 php
$updatedBucket = $client->updateBucket([
    'BucketId' => $bucket->getId(),
    'BucketType' => Bucket::TYPE_PUBLIC
]);
 php
$buckets = $client->listBuckets();
 php
$client->deleteBucket([
    'BucketId' => 'YOUR_BUCKET_ID'
]);
 php
$fileDelete = $client->deleteFile([
    'FileId' => $file->getId()

    // Can also identify the file via bucket and path:
    // 'BucketName' => 'my-special-bucket',
    // 'FileName' => 'path/to/file'
]);
 php
$fileList = $client->listFiles([
    'BucketId' => 'YOUR_BUCKET_ID'
]);