Controller.File メソッド

定義

オーバーロード

File(Byte[], String)

ファイルの内容およびファイルの種類を使用して FileContentResult オブジェクトを作成します。

File(Stream, String)

Stream オブジェクトおよびコンテンツ タイプを使用して FileStreamResult オブジェクトを作成します。

File(String, String)

ファイル名およびコンテンツ タイプを使用して FilePathResult オブジェクトを作成します。

File(Byte[], String, String)

ファイルの内容、コンテンツ タイプ、および対象ファイルの名前を使用して FileContentResult オブジェクトを作成します。

File(Stream, String, String)

Stream オブジェクト、コンテンツ タイプ、および対象ファイルの名前を使用して FileStreamResult オブジェクトを作成します。

File(String, String, String)

ファイル名、コンテンツ タイプ、およびダウンロードするファイルの名前を使用して FilePathResult オブジェクトを作成します。

File(Byte[], String)

ファイルの内容およびファイルの種類を使用して FileContentResult オブジェクトを作成します。

protected internal System.Web.Mvc.FileContentResult File (byte[] fileContents, string contentType);
member this.File : byte[] * string -> System.Web.Mvc.FileContentResult
Protected Friend Function File (fileContents As Byte(), contentType As String) As FileContentResult

パラメーター

fileContents
Byte[]

応答に送信するバイナリ コンテンツ。

contentType
String

コンテンツ タイプ (MIME タイプ)。

戻り値

ファイルの内容の結果オブジェクト。

適用対象

File(Stream, String)

Stream オブジェクトおよびコンテンツ タイプを使用して FileStreamResult オブジェクトを作成します。

protected internal System.Web.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType);
member this.File : System.IO.Stream * string -> System.Web.Mvc.FileStreamResult
Protected Friend Function File (fileStream As Stream, contentType As String) As FileStreamResult

パラメーター

fileStream
Stream

応答に送信するストリーム。

contentType
String

コンテンツ タイプ (MIME タイプ)。

戻り値

ファイルの内容の結果オブジェクト。

適用対象

File(String, String)

ファイル名およびコンテンツ タイプを使用して FilePathResult オブジェクトを作成します。

protected internal System.Web.Mvc.FilePathResult File (string fileName, string contentType);
member this.File : string * string -> System.Web.Mvc.FilePathResult
Protected Friend Function File (fileName As String, contentType As String) As FilePathResult

パラメーター

fileName
String

応答に送信するファイルのパス。

contentType
String

コンテンツ タイプ (MIME タイプ)。

戻り値

ファイル ストリームの結果オブジェクト。

適用対象

File(Byte[], String, String)

ファイルの内容、コンテンツ タイプ、および対象ファイルの名前を使用して FileContentResult オブジェクトを作成します。

protected internal virtual System.Web.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName);
abstract member File : byte[] * string * string -> System.Web.Mvc.FileContentResult
override this.File : byte[] * string * string -> System.Web.Mvc.FileContentResult
Protected Friend Overridable Function File (fileContents As Byte(), contentType As String, fileDownloadName As String) As FileContentResult

パラメーター

fileContents
Byte[]

応答に送信するバイナリ コンテンツ。

contentType
String

コンテンツ タイプ (MIME タイプ)。

fileDownloadName
String

ブラウザーに表示されるファイル ダウンロード ダイアログ ボックスで使用するファイル名。

戻り値

ファイルの内容の結果オブジェクト。

適用対象

File(Stream, String, String)

Stream オブジェクト、コンテンツ タイプ、および対象ファイルの名前を使用して FileStreamResult オブジェクトを作成します。

protected internal virtual System.Web.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName);
abstract member File : System.IO.Stream * string * string -> System.Web.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * string -> System.Web.Mvc.FileStreamResult
Protected Friend Overridable Function File (fileStream As Stream, contentType As String, fileDownloadName As String) As FileStreamResult

パラメーター

fileStream
Stream

応答に送信するストリーム。

contentType
String

コンテンツ タイプ (MIME タイプ)。

fileDownloadName
String

ブラウザーに表示されるファイル ダウンロード ダイアログ ボックスで使用するファイル名。

戻り値

ファイル ストリームの結果オブジェクト。

適用対象

File(String, String, String)

ファイル名、コンテンツ タイプ、およびダウンロードするファイルの名前を使用して FilePathResult オブジェクトを作成します。

protected internal virtual System.Web.Mvc.FilePathResult File (string fileName, string contentType, string fileDownloadName);
abstract member File : string * string * string -> System.Web.Mvc.FilePathResult
override this.File : string * string * string -> System.Web.Mvc.FilePathResult
Protected Friend Overridable Function File (fileName As String, contentType As String, fileDownloadName As String) As FilePathResult

パラメーター

fileName
String

応答に送信するファイルのパス。

contentType
String

コンテンツ タイプ (MIME タイプ)。

fileDownloadName
String

ブラウザーに表示されるファイル ダウンロード ダイアログ ボックスで使用するファイル名。

戻り値

ファイル ストリームの結果オブジェクト。

適用対象