public IActionResult File(int id) { var file = announcementService.GetUploadedFile(id); if (file != null) { return new FileContentResult(file.Content, MimeTypeMap.GetMimeType(file.FileExtension)) { FileDownloadName = file.FileName + file.FileExtension } } ; else { return(NotFound()); } }