Example #1
0
 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());
 }
Example #2
0
        public FileContentResult Get()
        {
            var buffer = _business.GetPdfFile();

            return(new FileContentResult(buffer, "application/PDF"));
        }