Sunday, June 8, 2014

How to stream a FileResult from one web server to another with ASP.NET MVC

MVC has a lot of great built in tooling, including the ability to stream very large file results straight from disk without having to load the whole file stream into memory.

What about the scenario where you want to stream a large file from one web server to another?

For example, I have an ASP.NET MVC application that needs to expose a download for a file hosted on another server, but I can not just redirect my users directly to the other URL. For that, we need to create a custom ActionResult type!

Search This Blog

About Tom

Tom DuPont is a Software Engineer. He has been a tool at CodeSmith, made love at Match, and now makes war for Blizzard. He specializes in C#, ASP.NET, and even that crazy JavaScript stuff. His views and opinions are his own.

Listen to Tom

Tom is a host on the QQ Cast, where he helps answer geek culture's most superfluous questions.