public IActionResult OnGet(int certificateId) { Certificate = _certificateData.GetCertificateById(certificateId); var stream = new FileStream(_fileUploader.GetRootPath(uploadPath, Certificate.CertificateFileName), FileMode.Open); return(new FileStreamResult(stream, "application/pdf")); }