0
votes

I have SQL database with a byte[] field. Using breeze I save binary image to that field. When I try to pull this DB entry back I see that the value of this field (on cliend side in the entity of entityManager) is base64 string!

here is the part of breeze metadata file that I use:

{ "name": "Photo1", "type": "Edm.Binary", "maxLength": "Max", "fixedLength": "false" }

I see that type is Edm.Binary so I expect to get binary but not a string.

How to avoid this transformation in breeze?

1
What problem do you have here? Base64 is a way to encode binary data. What's wrong with that?Adel Sal
@Adel Sal, I did send Array[24119] and received "/9j/4AAQSkZjRg...". I don't want to decode it from base64. I expect to get the same type as I sent.31415926

1 Answers

1
votes

Javascript does not have any native way of expressing a byte[], so the standard default is to use Base64.

For more information:

Binary Data in JSON String. Something better than Base64