partner-it / b2-php
Installs: 4 156
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.16
- partner-it/php-curl-wrapper: ~1.0
Requires (Dev)
This package is not auto-updated.
Last update: 2025-01-04 20:04:12 UTC
README
Backblaze B2 PHP wrapper
Installation
composer require partner-it/b2-php
Setup
Instantiate a new client and get a token:
$client = new \B2\B2Client('accountid', 'applicationKey'); $client->requestToken();
Upload a file
$client->Files->uploadFile('bucketId', '/my/local/path/image.jpg', 'image.jpg', 'image/jpeg');
Dowload a file
Download a file by name:
$data = $b2Client->Files->downloadFileByName('bucketname', 'image.jpg');