public ActionResult DownloadTemplate(int id) { var downloadFile = FileProcessor.CreateTemplateDownload((EducationSecurityPrincipal)User, TemplatePath, id); if (downloadFile == null) { return(HttpNotFound()); } var contentType = ExcelWriter.ContentType; return(File(downloadFile.FileContentStream, contentType, downloadFile.FileName)); }