I've taken over the following snippet:
$.ajax({ contentType: 'application/json; charset=utf-8', type: 'POST', url: '/api/generalapi/generatecsv', data: data, success: function (response) { window.open("data:text/csv;base64," + response, '', ''); } }); I've tried adding
filename=orders.csv to the window.open but the file still always comes down as "download". No extension or anything.
Is there any way of controlling the filename using the above code?