Skip to content

geeksarray/aspnet-core-mvc-returning-file-using-fileresult

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
obj
 
 
 
 
 
 
 
 
 
 

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published