I have in my asp.net core api controller
return new FileStreamResult(excel, "application/ms-excel")
{
FileDownloadName = filename
};
I am doing an ajax request to get this file
var response = axios.get(
`/endpoint`, {
responseType: 'blob'
});
then I am using a library called download which takes 3 parameters with one of them being "filename" and I am wondering if I can somehow get the filename that is coming from the server.
download(response.data,"test.xlsx", content);
Cors
services.AddCors(options => options.AddPolicy("Cors",
builder =>
{
builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
}));