I am using $.ajax to download a large CSV, which I am processing as it downloads using onprogress. I'd rather not retain all of the file contents in memory so that my tool has less of a memory footprint. But I don't know how to prevent jquery from retaining the entire csv contents to pass into the done method.
$.ajax(url, {
xhrFields: {
onprogress: function (e) {
//load up lines from this part of the file using e.currentTarget.response
}
}
})
.done(function (res) {
//don't need res here as processing is already done.
})
Does anyone know if there is some way of achieving this using $.ajax or something equivalent?