asp.net-mvcfileresulttype

What's the difference between the four File Results in ASP.NET MVC


ASP.NET has four different types of file results:

Those descriptions are take from MSDN and with the exception of the FileStreamResult the first three sound identical. So what is the difference between them?


Solution

  • FileResult is an abstract base class for all the others.

    However, you'll rarely have to use these classes - you can just use one of Controller.File overloads and let ASP.NET MVC do the magic for you.