共用方式為


PageModel.PhysicalFile 方法

定義

多載

PhysicalFile(String, String)

傳回 (physicalPathStatus200OK 所指定的檔案,) 指定 contentType 為 Content-Type。

PhysicalFile(String, String, String)

傳回指定 physicalPath () Status200OK 指定的檔案,其 contentType 指定為 Content-Type,以及指定 fileDownloadName 為建議的檔案名。

PhysicalFile(String, String)

來源:
PageModel.cs
來源:
PageModel.cs
來源:
PageModel.cs

傳回 (physicalPathStatus200OK 所指定的檔案,) 指定 contentType 為 Content-Type。

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

參數

physicalPath
String

要傳回之檔案的實體路徑。

contentType
String

檔案的內容類型。

傳回

為回應建立 PhysicalFileResult 的 。

適用於

PhysicalFile(String, String, String)

來源:
PageModel.cs
來源:
PageModel.cs
來源:
PageModel.cs

傳回指定 physicalPath () Status200OK 指定的檔案,其 contentType 指定為 Content-Type,以及指定 fileDownloadName 為建議的檔案名。

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

參數

physicalPath
String

要傳回之檔案的實體路徑。

contentType
String

檔案的內容類型。

fileDownloadName
String

建議的檔案名。

傳回

為回應建立 PhysicalFileResult 的 。

適用於