How to return an Excel file from a WebAPI ASP.NET Core
问题 In similar questions, with this code works to download a PDF: I'm testing with local files (.xlsx, .pdf, .zip) inside the Controller folder. Similar Question Here [HttpGet("downloadPDF")] public FileResult TestDownloadPCF() { HttpContext.Response.ContentType = "application/pdf"; FileContentResult result = new FileContentResult (System.IO.File.ReadAllBytes("Controllers/test.pdf"), "application/pdf") { FileDownloadName = "test.pdf" }; return result; } But when another file?, for example an