Class FileContentResult
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
stringThe 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
HttpResponseBaseThe response.