6
보기 (MVC)를 파일 만 은 대내보내기 엑셀 사실 내가 구현 한 엑셀로보기 데이터 내보내기에 내가 가진
return new FileContentResult(fileContents, "application/vnd.ms-excel");
을 사용할 때 내 의심의 여지가있다
return File(fileContents, "application/vnd.ms-excel");
및 각 방법에서 다운로드 가능한 파일 이름을 어떻게 설정할 수 있습니까?
예 1 :
public ActionResult ExcelExport()
{
byte[] fileContents = Encoding.UTF8.GetBytes(data);
return new FileContentResult(fileContents, "application/vnd.ms-excel");
}
예 : 2
public ActionResult ExcelExport()
{
byte[] fileContents = Encoding.UTF8.GetBytes(data);
return File(fileContents, "application/vnd.ms-excel");
}