Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created January 25, 2020 19:28
Show Gist options
  • Save CoreProgramm/1116a58b4a943a08349b08ab294dc5e3 to your computer and use it in GitHub Desktop.
Save CoreProgramm/1116a58b4a943a08349b08ab294dc5e3 to your computer and use it in GitHub Desktop.
public ActionResult Download()
{
string Files = "wwwroot/UploadExcel/CoreProgramm_ExcelImport.xlsx";
byte[] fileBytes = System.IO.File.ReadAllBytes(Files);
System.IO.File.WriteAllBytes(Files, fileBytes);
MemoryStream ms = new MemoryStream(fileBytes);
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, "employee.xlsx");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment