The .xlsx file is downloading, but opening says invalid format. I’ve also opened the file directly from site (not then downloaded) and it works fine.
Response.ClearContent();
Response.AddHeader(“Content-Disposition”, $“attachment; filename={path.Substring(path.LastIndexOf(’\’)+1)}”);
return File(path, “application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”);