Skip to content

Latest commit

 

History

History
19 lines (9 loc) · 1.3 KB

File metadata and controls

19 lines (9 loc) · 1.3 KB

Access SQL server database from .NET Core Console Application

This blog explains how you can return files to client from ASP.NET Core application using fileresult actionresults like FileContentResult, FileStreamResult, VirtualFileResult, PhysicalFileResult.

FileResult is an abstract base class for all file rendering action result, user can render file in the browser or download the required file using these built-in action results. By following this blog you will create a small application to understand FileResults by using all these FileResults.

Files

  1. Controller - implemention of all different types of FileResult, including generating file from database.
  2. MIME Dictionary - has a dictionary of all MIME mapping with file extension.

Image file is generated using FileContentResult

ASP.NET Core MVC File Result from Database

For more details of each FileResult please visit - https://geeksarray.com/blog/aspnet-core-mvc-returning-file-using-fileresult