PHPackages                             medoid/backblaze-b2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. medoid/backblaze-b2

ActiveLibrary[File &amp; Storage](/categories/file-storage)

medoid/backblaze-b2
===================

PHP SDK for working with backblaze B2 cloud storage.

1.4.2(5y ago)040MITPHPPHP ^7.2.5

Since Aug 9Pushed 5y agoCompare

[ Source](https://github.com/ramphor/backblaze-b2)[ Packagist](https://packagist.org/packages/medoid/backblaze-b2)[ Docs](https://github.com/gliterd/b2-sdk-php)[ RSS](/packages/medoid-backblaze-b2/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (24)Used By (0)

Backblaze B2 for PHP
--------------------

[](#backblaze-b2-for-php)

[![Author](https://camo.githubusercontent.com/9b27da4a3dc99169f09d93908a282ab361609e9f516e472b6441958dceea8b7f/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406d686574726572616d6573682d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/mhetreramesh)[![Latest Version on Packagist](https://camo.githubusercontent.com/8b0278022c3f6e41f8f8e040b5e5c11dbbbe8b26c6c26f4893a9dcbb21175290/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65646f69642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/medoid/backblaze-b2)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b9111a092e47fe72dee6a31784a0c9e706b0b534a6f30007c555b65bda4356ab/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d65646f69642f6261636b626c617a652d62322f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/medoid/backblaze-b2)[![Coverage Status](https://camo.githubusercontent.com/23d36827d8415bcf28201da7889a1912323ba3448de3870fffed272aac17bf83/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d65646f69642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/medoid/backblaze-b2/code-structure)[![Quality Score](https://camo.githubusercontent.com/75963766ae64713ad0e2ff38f0f87f8846fb1ea67ad3e685ae23c1c8f9393d5c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d65646f69642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/medoid/backblaze-b2)[![Total Downloads](https://camo.githubusercontent.com/e1986edf8a63ae0147d34b05a0fb5aed8c827801b8c2a386c1a20694a8f943bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65646f69642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/medoid/backblaze-b2)

`backblaze-b2` is the SDK for working with Backblaze's B2 storage service.

Install
-------

[](#install)

Via Composer

```
$ composer require medoid/backblaze-b2
```

Usage
-----

[](#usage)

```
use BackblazeB2\Client;
use BackblazeB2\Bucket;

$options = ['auth_timeout_seconds' => seconds];

$client = new Client('accountId', 'applicationKey', $options);
```

*$options* is optional. If omitted, the default timeout is 12 hours. The timeout allows for a long lived Client object so that the authorization token does not expire.

*ApplicationKey is not supported yet, please use MasterKey only*
----------------------------------------------------------------

[](#applicationkey-is-not-supported-yet-please-use-masterkey-only)

#### Returns a bucket details

[](#returns-a-bucket-details)

```
$bucket = $client->createBucket([
    'BucketName' => 'my-special-bucket',
    'BucketType' => Bucket::TYPE_PRIVATE // or TYPE_PUBLIC
]);
```

#### Change the bucket Type

[](#change-the-bucket-type)

```
$updatedBucket = $client->updateBucket([
    'BucketId' => $bucket->getId(),
    'BucketType' => Bucket::TYPE_PUBLIC
]);
```

#### List all buckets

[](#list-all-buckets)

```
$buckets = $client->listBuckets();
```

#### Delete a bucket

[](#delete-a-bucket)

```
$client->deleteBucket([
    'BucketId' => 'YOUR_BUCKET_ID'
]);
```

#### File Upload

[](#file-upload)

```
$file = $client->upload([
    'BucketName' => 'my-special-bucket',
    'FileName' => 'path/to/upload/to',
    'Body' => 'I am the file content'

    // The file content can also be provided via a resource.
    // 'Body' => fopen('/path/to/input', 'r')
]);
```

#### File Download

[](#file-download)

```
$fileContent = $client->download([
    'FileId' => $file->getId()

    // Can also identify the file via bucket and path:
    // 'BucketName' => 'my-special-bucket',
    // 'FileName' => 'path/to/file'

    // Can also save directly to a location on disk. This will cause download() to not return file content.
    // 'SaveAs' => '/path/to/save/location'
]);
```

#### File Delete

[](#file-delete)

```
$fileDelete = $client->deleteFile([
    'FileId' => $file->getId()

    // Can also identify the file via bucket and path:
    // 'BucketName' => 'my-special-bucket',
    // 'FileName' => 'path/to/file'
]);
```

#### List all files

[](#list-all-files)

```
$fileList = $client->listFiles([
    'BucketId' => 'YOUR_BUCKET_ID'
]);
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 77% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~98 days

Total

16

Last Release

2087d ago

Major Versions

0.0.3 → 1.0.02018-07-02

PHP version history (4 changes)0.0.1PHP &gt;=5.5.0

1.2.0PHP ^7.1.8

1.4.0PHP ^7.2

1.4.1PHP ^7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a609a3b3a36dee9f36ef6f8d3b2b2dc91eebefc7644031e829e65bca4329799?d=identicon)[puleeno](/maintainers/puleeno)

---

Top Contributors

[![mhetreramesh](https://avatars.githubusercontent.com/u/3095445?v=4)](https://github.com/mhetreramesh "mhetreramesh (77 commits)")[![puleeno](https://avatars.githubusercontent.com/u/22538657?v=4)](https://github.com/puleeno "puleeno (7 commits)")[![brino](https://avatars.githubusercontent.com/u/986822?v=4)](https://github.com/brino "brino (7 commits)")[![stevecoug](https://avatars.githubusercontent.com/u/432808?v=4)](https://github.com/stevecoug "stevecoug (2 commits)")[![fozbek](https://avatars.githubusercontent.com/u/17993880?v=4)](https://github.com/fozbek "fozbek (2 commits)")[![Koenvh1](https://avatars.githubusercontent.com/u/5168825?v=4)](https://github.com/Koenvh1 "Koenvh1 (2 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")[![ggiak](https://avatars.githubusercontent.com/u/20743694?v=4)](https://github.com/ggiak "ggiak (1 commits)")[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (1 commits)")

---

Tags

filesystemcloudbackupstorageb2backblazecloud-storage

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/medoid-backblaze-b2/health.svg)

```
[![Health](https://phpackages.com/badges/medoid-backblaze-b2/health.svg)](https://phpackages.com/packages/medoid-backblaze-b2)
```

###  Alternatives

[gliterd/backblaze-b2

PHP SDK for working with backblaze B2 cloud storage.

84263.3k8](/packages/gliterd-backblaze-b2)[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[cwhite92/b2-sdk-php

A SDK for working with B2 cloud storage.

74146.6k2](/packages/cwhite92-b2-sdk-php)[obregonco/backblaze-b2

An SDK for working with B2 cloud storage.

2732.9k](/packages/obregonco-backblaze-b2)[bringyourownideas/laravel-backblaze

Backblaze B2 Cloud Storage for Laravel 5. Original by Paul Olthof (@hpolthof) continued by @bringyourownideas

1237.8k](/packages/bringyourownideas-laravel-backblaze)[innoge/laravel-rclone

A sleek PHP wrapper around rclone with Laravel-style fluent API syntax

174.1k](/packages/innoge-laravel-rclone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
