b2-sdk-php
b2-sdk-php copied to clipboard
Image Blob gets 'Sha1 did not match data received'
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've also been experiencing an issue similar. I installed this SDK via composer on 2 systems - one running PHP5 & Apache and the other PHP7 & nginx. The PHP5 system worked, however I also got an error relating to the SHA1 hash not matching.
From looking around a few other Github repositories for PHP SDKs for B2 (https://github.com/gliterd/backblaze-b2/pull/16), it seems that the issue may be with the use of mb_strlen at https://github.com/cwhite92/b2-sdk-php/blob/master/src/Client.php#L197 I changed this to strlen, and the error was no longer present after this change.
Hope this is of use to you.
I've also been experiencing an issue similar. I installed this SDK via composer on 2 systems - one running PHP5 & Apache and the other PHP7 & nginx. The PHP5 system worked, however I also got an error relating to the SHA1 hash not matching.
From looking around a few other Github repositories for PHP SDKs for B2 (gliterd/backblaze-b2#16), it seems that the issue may be with the use of mb_strlen at https://github.com/cwhite92/b2-sdk-php/blob/master/src/Client.php#L197 I changed this to strlen, and the error was no longer present after this change.
Hope this is of use to you.
Awesome! I've been writing my image blob to a file as a quick work around, but I'll implement this fix when I get home, thanks!
I forked the repo and merging the PRs in there. You can access it here: https://github.com/tarikozket/b2-sdk-php