Monday, 26 August 2013

What are the valid content types for Controller.File()?

What are the valid content types for Controller.File()?

I'm using MVC 4 in Visual Studio. I want to know how to create a file with
the Controller.File() method. I understand I need to pass a file type.
What are the valid file types? I'm not seeing this in the documentation
(http://msdn.microsoft.com/en-us/library/dd492492(v=vs.108).aspx).
Example code:
return File(answers, "txt",filename);
Is there a list of content types that someone can reference me? I need to
know format of the "txt" argument (or whatever I'm supposed to be putting
there) basically (e.g. "txt" or ".txt" or "text/html" or "*.txt", etc.).

No comments:

Post a Comment