0

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?

31415926
  • 3,811
  • 7
  • 47
  • 78
  • What problem do you have here? Base64 is a way to encode binary data. What's wrong with that? – Adel Sal Jun 06 '14 at 11:48
  • @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 Jun 06 '14 at 15:01

1 Answers1

1

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

Community
  • 1
  • 1
Jay Traband
  • 17,053
  • 1
  • 23
  • 44