Table of Contents

Class FileContentResult

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Sends the contents of a binary file to the response.

public class FileContentResult : FileResult
Inheritance
FileContentResult
Inherited Members

Constructors

FileContentResult(byte[], string)

Initializes a new instance of the FileContentResult class by using the specified file contents and content type.

public FileContentResult(byte[] fileContents, string contentType)

Parameters

fileContents byte[]

The byte array to send to the response.

contentType string

The content type to use for the response.

Exceptions

ArgumentNullException

The fileContents parameter is null.

Properties

FileContents

The binary content to send to the response.

public byte[] FileContents { get; }

Property Value

byte[]

The file contents.

Methods

WriteFile(HttpResponseBase)

Writes the file content to the response.

protected override void WriteFile(HttpResponseBase response)

Parameters

response HttpResponseBase

The response.