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.
- Controller - implemention of all different types of FileResult, including generating file from database.
- MIME Dictionary - has a dictionary of all MIME mapping with file extension.
Image file is generated using FileContentResult
For more details of each FileResult please visit - https://geeksarray.com/blog/aspnet-core-mvc-returning-file-using-fileresult