fileresult

FileResult returning corrupt file

I'm creating a simple controller action in ASP.NET MVC 2 (under the .NET 4.0 framework) which will resize files. I've got a controller like this (I've cut it down a bit): public ActionResult GetFile(int fileId, string fileSource) { FileInfo file = repo.FindFileById(fileId); //do some resizing string mimeType = string.Empt...

Download file of any type in Asp.Net MVC using FileResult?

I've had it suggested to me that I should use FileResult to allow users to download files from my Asp.Net MVC application. But the only examples of this I can find always has to do with image files (specifying content type image/jpeg). But what if I can't know the file type? I want users to be able to download pretty much any file from...