basho / riak-php-client

PHP clients for Riak
Apache License 2.0
160 stars 69 forks source link

Binary data - decode breaks submission [JIRA: CLIENTS-918] #122

Closed benscott closed 7 years ago

benscott commented 8 years ago

I'm trying to submit binary image data, for example:

    $object = new Object();
    $object->setContentType('image/jpeg');
    $object->setContentEncoding("base64");
    $object->setData([BINARY IMAGE]);

    $command = (new Command\Builder\StoreObject([RIAK]))
        ->withObject($object)
        ->atLocation([LOCATION])
        ->build()
       ->execute()

The problem is the binary data gets encoded before submission to Riak, so it seems the binary data isn't stored properly in Riak (the image returned out of Riak over HTTP isn't displayable). To fix this we're checking the object's content encoding, and if binary/base64 returning the object data unencoded (see pull request).

Basho-JIRA commented 8 years ago

PRs:

_[posted via JIRA by Derek Somogyi]_

christophermancini commented 7 years ago

This should be resolved via the changes in #131

Basho-JIRA commented 7 years ago

This is done

On Mon, Oct 17, 2016, 12:09 PM Derek Somogyi (JIRA) <

Sincerely,

Christopher Mancini

employee = { purpose: solve problems with code, phone: 7164625591, email: cmancini@basho.com, github: http://www.github.com/christophermancini }

_[posted via JIRA by Christopher Mancini]_