ControllerBase.PhysicalFile ControllerBase.PhysicalFile ControllerBase.PhysicalFile Method

Definition

Overloads

PhysicalFile(String, String) PhysicalFile(String, String) PhysicalFile(String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, Boolean) PhysicalFile(String, String, Boolean) PhysicalFile(String, String, Boolean)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, String) PhysicalFile(String, String, String) PhysicalFile(String, String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Returns the file specified by physicalPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, String, Boolean) PhysicalFile(String, String, String, Boolean) PhysicalFile(String, String, String, Boolean)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Returns the file specified by physicalPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Returns the file specified by physicalPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Returns the file specified by physicalPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

PhysicalFile(String, String) PhysicalFile(String, String) PhysicalFile(String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType);
abstract member PhysicalFile : string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

Returns

PhysicalFile(String, String, Boolean) PhysicalFile(String, String, Boolean) PhysicalFile(String, String, Boolean)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, bool enableRangeProcessing);
abstract member PhysicalFile : string * string * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, enableRangeProcessing As Boolean) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

PhysicalFile(String, String, String) PhysicalFile(String, String, String) PhysicalFile(String, String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName);
abstract member PhysicalFile : string * string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * string -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, fileDownloadName As String) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

Returns

PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Returns the file specified by physicalPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
abstract member PhysicalFile : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

PhysicalFile(String, String, String, Boolean) PhysicalFile(String, String, String, Boolean) PhysicalFile(String, String, String, Boolean)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, bool enableRangeProcessing);
abstract member PhysicalFile : string * string * string * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * string * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, fileDownloadName As String, enableRangeProcessing As Boolean) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Returns the file specified by physicalPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
abstract member PhysicalFile : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Returns the file specified by physicalPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
abstract member PhysicalFile : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean) PhysicalFile(String, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Returns the file specified by physicalPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
abstract member PhysicalFile : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
override this.PhysicalFile : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.PhysicalFileResult
Public Overridable Function PhysicalFile (physicalPath As String, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As PhysicalFileResult
Parameters
physicalPath
String String String

The path to the file. The path must be an absolute path.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

Applies to