コード例 #1
0
        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")));
        }
コード例 #2
0
        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));
        }