AJAX is the wrong approach. Simply do an HTTP GET to the an action that returns a file.
public IActionResult FileHandler(string id)
{
//look up the Id
var path = Path.Combine(Environment.ContentRootPath, @$"wwwroot/Content/{id}");
var fileStream = System.IO.File.OpenRead(path);
return File(fileStream, "application/octet-stream");
}
JavaScript/jQuery
$('.download').click(function (e) {
e.preventDefault();
location.href = 'file/FileHandler/' + this.value
});
Markup
<div>
<button class="badge badge-primary badge-pill download" value="lespaul.jpg">Download</button>
</div>