PageModel.PhysicalFile 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
PhysicalFile(String, String) |
傳回 ( |
PhysicalFile(String, String, String) |
傳回指定 |
PhysicalFile(String, String)
- 來源:
- PageModel.cs
- 來源:
- PageModel.cs
- 來源:
- PageModel.cs
傳回 (physicalPath
Status200OK 所指定的檔案,) 指定 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 的 。