F3 - Download CSV generated with PHP in AJAX [closed]

1

I have a web application that generates a CSV from a query to a BD, which I want to download, I am calling the route that generates the file through an Ajax request, but I have no idea how to download it. file.

$.ajax({
    type: 'POST',
    url: direccion() + 'descargas/exportar',
    dataType: '//Que tipo deberia poner¿?'
}).done(function () {
    //Aqui se debería guardar el archivo
}).fail(function (xhr, status, error) {
    alert('Error ' + xhr.status + '. ' + error + ': ' + xhr.responseText);
});
    
asked by Cezaryto 20.12.2016 в 19:47
source

0 answers