Therefore, I use MVC 2 to display some images from the controller action. Common wisdom ( 1 , 2 , 3 ), it seems you should use one of the FileResult types ( FileStreamResult , FileContentResult or `FileContentResult ').
All three specific FileResult 's, however, set the Content-Disposition response header using attachment; filename{YourFileNameHere}=UTF-8 attachment; filename{YourFileNameHere}=UTF-8 . The end result is that if the user views my image directly, and is not embedded in HTML, the browser displays a save dialog rather than showing the image. I would prefer the image to just display in the browser.
I think this begs my question: Using MVC 2 How can I return the result of an image where the image is NOT marked for upload?
asp.net-mvc-2
EBarr
source share