Table of Contents

Class FilePathResult

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

Sends the contents of a file to the response.

public class FilePathResult : FileResult
Inheritance
FilePathResult
Inherited Members

Constructors

FilePathResult(string, string)

Initializes a new instance of the FilePathResult class by using the specified file name and content type.

public FilePathResult(string fileName, string contentType)

Parameters

fileName string

The name of the file to send to the response.

contentType string

The content type of the response.

Exceptions

ArgumentException

The fileName parameter is null or empty.

Properties

FileName

Gets or sets the path of the file that is sent to the response.

public string FileName { get; }

Property Value

string

The path of the file that is sent to the response.

Methods

WriteFile(HttpResponseBase)

Writes the file to the response.

protected override void WriteFile(HttpResponseBase response)

Parameters

response HttpResponseBase

The response.