Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Image Blob gets 'Sha1 did not match data received' #24

Open
czzplnm opened this issue Oct 1, 2018 · 3 comments
Open

Image Blob gets 'Sha1 did not match data received' #24

czzplnm opened this issue Oct 1, 2018 · 3 comments

Comments

@czzplnm
Copy link

czzplnm commented Oct 1, 2018

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?

@Matthew-Kilpatrick
Copy link

Matthew-Kilpatrick commented Oct 31, 2018

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.

@czzplnm
Copy link
Author

czzplnm commented Oct 31, 2018

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!

@tarikozket
Copy link

I forked the repo and merging the PRs in there. You can access it here: https://github.com/tarikozket/b2-sdk-php

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants