0

I need to return textual data from server along with binary data(file) as JSon object which later will be used with jQuery(ASP.NET app at server side). I can encode file with Base64 and put it inside JSon object, as I know there is no way to access binary data using jQuery from JSon object at client side. So how to call server using jQuery, read textual JSon data and somehow send file at the same request.

Any suggestions?

Tomas
  • 17,551
  • 43
  • 152
  • 257

1 Answers1

0

You can send information about a file in jQuery request and send to client path to it. And then you can open file with this path with window.open('{File path}').

You can download the file with Generic handler ashx: Downloading files using ASP.NET .ashx modules

For example:

window.open(file.filePath);
Community
  • 1
  • 1
Baidaly
  • 1,829
  • 1
  • 15
  • 16