If you are working on an older MVC 5 project, the syntax is almost identical to ASP.NET Core, as it also uses the FileResult .
Web Forms doesn't have the "Action Result" pattern, so you have to manipulate the Response object manually.
In modern ASP.NET Core, the ControllerBase class provides a built-in method called File() . This is the cleanest and most efficient way to handle downloads. The Implementation