1

im using the ASP MVC REST implementation and extracting image data from a table and sending it through json what is the best practice in doing this inside the controller?

thanks a lot :D

Joel Coehoorn
  • 380,066
  • 110
  • 546
  • 781

2 Answers2

1

Your best bet would be to convert the binary image file as a base64 string on the server before sending it to the client then convert it back into binary on the client.

There's a great question here that describes some of the nuances of this approach

Community
  • 1
  • 1
lomaxx
  • 109,635
  • 56
  • 141
  • 178
1

Convert your image file to Base64 and use it.

Ardent Coder
  • 3,499
  • 9
  • 25
  • 46