In MVC, we have used following code to download a file. In ASP.NET core, how to achieve this?
HttpResponse response = HttpContext.Current.Response;
You can try below code to download the file. It should return the FileResult
public ActionResult DownloadDocument()
{
string filePath = "your file path";
string fileName = ""your file name;
byte[] fileBytes = System.IO.File.ReadAllBytes(filePath);
return File(fileBytes, "application/force-download", fileName);
}