FileContentResult 類別

定義

表示 ActionResult 執行時,將二進位檔寫入回應的 。

public ref class FileContentResult : Microsoft::AspNetCore::Mvc::FileResult
public class FileContentResult : Microsoft.AspNetCore.Mvc.FileResult
type FileContentResult = class
    inherit FileResult
Public Class FileContentResult
Inherits FileResult
繼承
FileContentResult

建構函式

FileContentResult(Byte[], MediaTypeHeaderValue)

使用提供的 fileContents 和 提供的 contentType ,建立新的 FileContentResult 實例。

FileContentResult(Byte[], String)

使用提供的 fileContents 和 提供的 contentType ,建立新的 FileContentResult 實例。

屬性

ContentType

取得回應的 Content-Type 標頭。

(繼承來源 FileResult)
EnableRangeProcessing

取得或設定值,這個值會啟用 的範圍 FileResult 處理。

(繼承來源 FileResult)
EntityTag

取得或設定與 FileResult 相關聯的 etag。

(繼承來源 FileResult)
FileContents

取得或設定檔案內容。

FileDownloadName

取得將用於回應之 Content-Disposition 標頭中的檔案名。

(繼承來源 FileResult)
LastModified

取得或設定與 FileResult 相關聯的上次修改資訊。

(繼承來源 FileResult)

方法

ExecuteResult(ActionContext)

同步執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

(繼承來源 ActionResult)
ExecuteResultAsync(ActionContext)

以非同步方式執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。 此方法的預設實作會呼叫 ExecuteResult(ActionContext) 方法,並傳回已完成的工作。

適用於