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
  • 399,467
  • 113
  • 570
  • 794

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
  • 113,627
  • 57
  • 144
  • 179
1

Convert your image file to Base64 and use it.

Ardent Coder
  • 3,777
  • 9
  • 27
  • 53