PHPackages                             sevend93/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. sevend93/backblaze-b2

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

sevend93/backblaze-b2
=====================

PHP SDK for working with backblaze B2 cloud storage.

1.3.2(6y ago)077MITPHPPHP ^7.1.8

Since Aug 9Pushed 6y agoCompare

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

READMEChangelog (1)Dependencies (5)Versions (22)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/1b55cfdf5ccc14d552ab72ad2e721e3ec4ac797d9cedb5251f9c4b6414d083d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676c69746572642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gliterd/backblaze-b2)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9c0b21960ca8dfff50d9de8ee141ed525a9a4e3c6f5dc26d3268c13dc3ed21cf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f676c69746572642f6261636b626c617a652d62322f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/gliterd/backblaze-b2)[![Coverage Status](https://camo.githubusercontent.com/463c5bc28c87da96bdb17915868e1df1dc02ef28b5fe72644272706d5cf0b283/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f676c69746572642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gliterd/backblaze-b2/code-structure)[![Quality Score](https://camo.githubusercontent.com/edaaa054975d996769365d420df149acd714d61fac58d1405bd71eaab09a4902/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f676c69746572642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gliterd/backblaze-b2)[![Total Downloads](https://camo.githubusercontent.com/45fdc42db37146ac983ea4eb9dfc70c07a9deb8ff8eaf3d9f39975fe65f011c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676c69746572642f6261636b626c617a652d62322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gliterd/backblaze-b2)

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

Install
-------

[](#install)

Via Composer

```
$ composer require gliterd/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

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 80.7% 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 ~65 days

Recently: every ~81 days

Total

14

Last Release

2346d ago

Major Versions

0.0.3 → 1.0.02018-07-02

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

1.2.0PHP ^7.1.8

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ea5ad95d058680caf27f9aef5a44f9f7b43b7898f6af7d22d26bc15a69c8ea7?d=identicon)[sevend93](/maintainers/sevend93)

---

Top Contributors

[![mhetreramesh](https://avatars.githubusercontent.com/u/3095445?v=4)](https://github.com/mhetreramesh "mhetreramesh (67 commits)")[![brino](https://avatars.githubusercontent.com/u/986822?v=4)](https://github.com/brino "brino (7 commits)")[![Koenvh1](https://avatars.githubusercontent.com/u/5168825?v=4)](https://github.com/Koenvh1 "Koenvh1 (2 commits)")[![fozbek](https://avatars.githubusercontent.com/u/17993880?v=4)](https://github.com/fozbek "fozbek (2 commits)")[![stevecoug](https://avatars.githubusercontent.com/u/432808?v=4)](https://github.com/stevecoug "stevecoug (2 commits)")[![sevend93](https://avatars.githubusercontent.com/u/6322531?v=4)](https://github.com/sevend93 "sevend93 (2 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")

---

Tags

filesystemcloudbackupstorageb2backblazecloud-storage

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/sevend93-backblaze-b2/health.svg)](https://phpackages.com/packages/sevend93-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.1k](/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)[google/cloud

Google Cloud Client Library

1.2k16.2M54](/packages/google-cloud)[bringyourownideas/laravel-backblaze

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

1237.8k](/packages/bringyourownideas-laravel-backblaze)

PHPackages © 2026

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