ControllerBase.PhysicalFile 方法

定義

多載

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

傳回 physicalPath 所指定的檔案(Status200OK)、指定的 contentType 為 Content-Type,以及指定的 fileDownloadName 為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

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

傳回 physicalPath 所指定的檔案(Status200OK)、指定的 contentType 為 Content-Type,以及指定的 fileDownloadName 為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

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

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 傳回為 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

PhysicalFile(String, String, String, Boolean)

傳回 physicalPathStatus200OK) 所指定的檔案,指定 contentType 為 Content-Type,並將指定的 fileDownloadName 指定為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

PhysicalFile(String, String, Boolean)

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 當做 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

PhysicalFile(String, String, String)

傳回 physicalPathStatus200OK) 所指定的檔案,指定 contentType 為 Content-Type,並將指定的 fileDownloadName 指定為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

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

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 傳回為 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

PhysicalFile(String, String)

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 當做 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

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

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回 physicalPath 所指定的檔案(Status200OK)、指定的 contentType 為 Content-Type,以及指定的 fileDownloadName 為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, System::String ^ fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

fileDownloadName
String

建議的檔名。

lastModified
Nullable<DateTimeOffset>

上次修改檔案時的 DateTimeOffset

entityTag
EntityTagHeaderValue

與檔案相關聯的 EntityTagHeaderValue

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

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

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回 physicalPath 所指定的檔案(Status200OK)、指定的 contentType 為 Content-Type,以及指定的 fileDownloadName 為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, System::String ^ fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

fileDownloadName
String

建議的檔名。

lastModified
Nullable<DateTimeOffset>

上次修改檔案時的 DateTimeOffset

entityTag
EntityTagHeaderValue

與檔案相關聯的 EntityTagHeaderValue

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

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

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 傳回為 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

lastModified
Nullable<DateTimeOffset>

上次修改檔案時的 DateTimeOffset

entityTag
EntityTagHeaderValue

與檔案相關聯的 EntityTagHeaderValue

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

PhysicalFile(String, String, String, Boolean)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回 physicalPathStatus200OK) 所指定的檔案,指定 contentType 為 Content-Type,並將指定的 fileDownloadName 指定為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, System::String ^ fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string? fileDownloadName, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

fileDownloadName
String

建議的檔名。

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

PhysicalFile(String, String, Boolean)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 當做 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

PhysicalFile(String, String, String)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回 physicalPathStatus200OK) 所指定的檔案,指定 contentType 為 Content-Type,並將指定的 fileDownloadName 指定為建議的檔名。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, System::String ^ fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, string? fileDownloadName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

fileDownloadName
String

建議的檔名。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

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

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 傳回為 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

lastModified
Nullable<DateTimeOffset>

上次修改檔案時的 DateTimeOffset

entityTag
EntityTagHeaderValue

與檔案相關聯的 EntityTagHeaderValue

傳回

為回應建立的 PhysicalFileResult

屬性

適用於

PhysicalFile(String, String)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

傳回由 physicalPathStatus200OK) 所指定的檔案,並將指定的 contentType 當做 Content-Type。 這支援範圍要求(如果無法滿足範圍,Status206PartialContentStatus416RangeNotSatisfiable)。

public:
 virtual Microsoft::AspNetCore::Mvc::PhysicalFileResult ^ PhysicalFile(System::String ^ physicalPath, System::String ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.PhysicalFileResult PhysicalFile (string physicalPath, string contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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

參數

physicalPath
String

檔案的路徑。 路徑必須是絕對路徑。

contentType
String

檔案的內容類型。

傳回

為回應建立的 PhysicalFileResult

屬性

適用於