Export (0) Print
Expand All

Controller.File Method

Creates a FileContentResult object.

  NameDescription
Protected method File(Byte[], String) Creates a FileContentResult object using the file contents and file type.
Protected method File(Stream, String) Creates a FileStreamResult object using the Stream object and content type.
Protected method File(String, String) Creates a FilePathResult object using the file name and the content type.
Protected method File(Byte[], String, String) Creates a FileContentResult object using the file contents, content type, and the target file name.
Protected method File(Stream, String, String) Creates a FileStreamResult object using the Stream object, the content type, and the target file name.
Protected method File(String, String, String) Creates a FilePathResult object using the file name, content type and file download name.
Top

The File() helper method provides support for returning the contents of a file. The MediaTypeNames class can be used to get the MIME type for a particular file extension.

Community Additions

Show:
© 2014 Microsoft