I make an ajax call as
var formData = new FormData();
formData.append('name', 'John');
formData.append('company', 'ABC');
$.ajax({
url: url,
data: formData,
processData: false,
contentType: false,
success: function(data){
window.location.href = data.URL; // data does not have URL attribute.
},
error: function(jqXHR, textStatus, errorThrown){
console.log(jqXHR.responseText)
}
});
The server responds with an excel file.
I can see the file in the response headers in the chrome inspector.
If i do a console.log(jqXHR.responseText)
i can see garbage / encoded data on the console. How do I download this data which is encoded.
It does not automatically bring the download box as expected.