public ActionResult DownloadHealthFormDocument(int studentId, int healthFormId) { var file = SchoolLocator.StudentService.DownloadStudentHealthFormDocument(studentId, healthFormId); Response.AddHeader(CONTENT_DISPOSITION, string.Format(HEADER_FORMAT, "StudentHealthForm.pdf")); return(File(file, MimeHelper.GetContentTypeByExtension("pdf"))); }
private ActionResult DownloadReportFile(byte[] report, string reportFileName, ReportingFormat formatType) { Response.AppendCookie(new HttpCookie("chlk-iframe-ready", Guid.NewGuid().ToString())); var extension = formatType.AsFileExtension(); var fileName = $"{reportFileName}.{extension}"; MasterLocator.UserTrackingService.CreatedReport(Context.Login, reportFileName); return(File(report, MimeHelper.GetContentTypeByExtension(extension), fileName)); }