public IActionResult DownloadBook(string filename) { var book = _ebookManager.GetByFilename(filename); string path = Path.Combine(ConfigurationManager.FileDir, book.Filename); byte[] fileBytes = System.IO.File.ReadAllBytes(path); return(File(fileBytes, "application/pdf", book.Filename)); }