Is it possible to make an ajax call (using Jquery) to request a file.
(The ajax call passes back a chunk of information) the Server reponds by sending a file or an error message.
If the server sends the file I would like the browser to handle the request so you get the browser's standard file download action.
Is that doable? Or is it only possible to answer ajax calls with data responses?
Currently I'm returning the following from the controller:
return File(report, "application/pdf","test.pdf");
(Where report is a byte array)
This is sent ok but is handled by the brower's XMLHttpRequest
not by the browser.
Annoyingly for various reasons I can't use a form post.