cwhite92 / b2-sdk-php Goto Github PK
View Code? Open in Web Editor NEWSDK for Backblaze's B2 storage service.
License: MIT License
SDK for Backblaze's B2 storage service.
License: MIT License
Should be authorizeAccount (with a 'z') in Client.php, both in the comment and method definition (Lines 398 & 402), as well as when it's called on line 37.
For some reason the hash for the get list of files isn't populated. Instead it's explicitly set to null.
Please include it - it's just a few characters in client.php:
$files[] = new File($file['fileId'], $file['fileName'], $file['contentSha1'], $file['size']);
I'd like to see support for Large Files. You can reference https://www.backblaze.com/b2/docs/large_files.html for more info. I think this could widen the use case for this SDK quite a bit as the world of media expands and gets larger.
If I try to send an imageBlob as the body I get from Backblaze:
Sha1 did not match data received
Can we send raw data in the body, without using a file object?
I see that this library is one of the most complete around, but I wonder if it is still alive/active, since I see some PRs that are there for many months and have not been approved yet.
Thanks in advance.
Could you generate a new release with the changes that exists only in master? #9 is needed for the client to work.
Currently in ErrorHandler.php you only show the error message. This is bad because B2 unhelpfully very often leaves this field blank.
Include the error code too:
throw new $exceptionClass('Received error from B2: '.$responseJson['message'].' Code: '.$responseJson['code']);
Hi,
We have a platform where we usually upload up to 50 files from a user (images), where each upload can take up to 20 seconds for an image of 2MB. We have found that the uploads are extremely slow in regards of this. I was in contact with Backblaze B2-support and they suggested maybe it has something to do with HTTPS-verification or such things.
I will try to create an isolated test-case, but until then - do you have any thoughts on this? Is it a mis-configured server on our end; or are uploads typically these slow?
Backblaze API requires you to cache this in order to not get rate limited.
Will hopefully be able to provide you with a PR.
In the b2 upload doc there is a X-Bz-Info header present.
Up to 10 of these headers may be present. The * part of the header name is replace with the name of a custom field in the file information stored with the file, and the value is an arbitrary UTF-8 string, percent-encoded. The same info headers sent with the upload will be returned with the download. The header name is case insensitive.
I have seen that you use this to pass on the file last modified time, but I haven't seen any support for custom X-Bz-Info headers.
'X-Bz-Info-src_last_modified_millis' => $options['FileLastModified']
Hello,
Trying to upload like so
$file = $client->upload([
'BucketId' => $bucketId,
'BucketName' => $bucketName,
'FileName' => $filename,
'Body' => $file2Send
]);
results in this exception: Received error from B2: error reading uploaded data
.
I tought it was on their end, so I emailed them but it seems that they're throwing the ball back at us, so I tought I should post it to see if it was of any help! :)
Did you ensure that you have a vaild upload token?
If the HTTP return status is anything other than 200, the caller must not upload to this URL again. Instead the caller MUST call b2_get_upload_url to get a new uploadUrl and new authorizationToken. The reason for this is that the individual storage pod you are uploading into may be full of data and thus will never accept any more data for now, or it has crashed, or has been placed into maintenance and will not accept data, etc. No matter what the reason, you must use b2_get_upload_url to get a new uploadUrl and new authorizationToken in order to retry the upload.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.