public IActionResult GetPDFFile() { byte[] buffer = _fileBusiness.GetPdfFile(); if (buffer != null) { HttpContext.Response.ContentType = "application/pdf"; HttpContext.Response.Headers.Add("content-length", buffer.Length.ToString()); HttpContext.Response.Body.Write(buffer, 0, buffer.Length); } return(new ContentResult()); }
public FileContentResult Get() { var buffer = _business.GetPdfFile(); return(new FileContentResult(buffer, "application/PDF")); }