ControllerBase.File Methode

Definition

Überlädt

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

Gibt die datei zurück, die durch virtualPath (Status200OK), die als Content-Type und die angegebene fileDownloadName als vorgeschlagener Dateiname angegeben contentType ist. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK), das als Inhaltstyp angegebene contentType und den als vorgeschlagenen Dateinamen angegebenen fileDownloadName zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

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

Gibt die datei zurück, die durch virtualPath (Status200OK), die als Content-Type und die angegebene fileDownloadName als vorgeschlagener Dateiname angegeben contentType ist. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

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

Gibt die durch virtualPath (Status200OK) angegebene Datei und die als Content-Type angegebene contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei im angegebenen fileStream (Status200OK), das als Inhaltstyp angegebene contentType und den als vorgeschlagenen Dateinamen angegebenen fileDownloadName zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) und den angegebenen als Inhaltstyp zurück contentType . Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(String, String, String, Boolean)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type und contentType dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

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

Gibt die durch virtualPath (Status200OK) angegebene Datei und die als Content-Type angegebene contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, String, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, String, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei im angegebenen fileStream (Status200OK) und den angegebenen als Inhaltstyp zurück contentType . Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, String)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(String, String)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, String)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(String, String, Boolean)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(String, String, String)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type und contentType dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

File(Stream, String, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

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

Gibt die von virtualPath (Status200OK), als Inhaltstyp angegebene contentType Datei und den als vorgeschlagenen Dateinamen angegebenen fileDownloadName zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, 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.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei in dem angegebenen fileStream (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, 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.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As FileStreamResult

Parameter

fileStream
Stream

Der Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei mit dem angegebenen fileContents Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, 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.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

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

Gibt die von virtualPath (Status200OK), als Inhaltstyp angegebene contentType Datei und den als vorgeschlagenen Dateinamen angegebenen fileDownloadName zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, System::String ^ fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

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

Gibt die von virtualPath (Status200OK) angegebene Datei und die als Inhaltstyp angegebene contentType datei zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(Stream, String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei in dem angegebenen fileStream (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, System::String ^ fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As FileStreamResult

Parameter

fileStream
Stream

Der Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) und die als Inhaltstyp angegebene contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As FileStreamResult

Parameter

fileStream
Stream

Der Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Byte[], String, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei mit dem angegebenen fileContents Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, System::String ^ fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string? fileDownloadName, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, fileDownloadName As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue, Boolean)

Gibt eine Datei mit dem angegebenen fileContents inhalt (Status200OK) und dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue, enableRangeProcessing As Boolean) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(String, String, String, Boolean)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Inhaltstyp und contentType dem fileDownloadName angegebenen als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, System::String ^ fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string? fileDownloadName, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * string * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * string * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, fileDownloadName As String, enableRangeProcessing As Boolean) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

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

Gibt die von virtualPath (Status200OK) angegebene Datei und die als Inhaltstyp angegebene contentType datei zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts, zu dem die Datei zuletzt geändert wurde.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(Stream, String, String, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurückcontentType. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, System::String ^ fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string? fileDownloadName, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * string * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * string * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, fileDownloadName As String, enableRangeProcessing As Boolean) As FileStreamResult

Parameter

fileStream
Stream

Der Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Stream, String)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String) As FileStreamResult

Parameter

fileStream
Stream

Der Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Byte[], String, String, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, System::String ^ fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string? fileDownloadName, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * string * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * string * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, fileDownloadName As String, enableRangeProcessing As Boolean) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(Byte[], String)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(Stream, String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei im angegebenen fileStream (Status200OK) und den angegebenen als Inhaltstyp zurück contentType . Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As FileStreamResult

Parameter

fileStream
Stream

Die Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts der letzten Änderung der Datei.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(Byte[], String, Boolean)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * bool -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, enableRangeProcessing As Boolean) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(Byte[], String, String)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK), dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, System::String ^ fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string? fileDownloadName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * string -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * string -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, fileDownloadName As String) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(String, String)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(Stream, String, String)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem contentType angegebenen als Inhaltstyp und dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, System::String ^ fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string? fileDownloadName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * string -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * string -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, fileDownloadName As String) As FileStreamResult

Parameter

fileStream
Stream

Die Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für:

File(String, String, Boolean)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * bool -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, enableRangeProcessing As Boolean) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(String, String, String)

Gibt die von virtualPath (Status200OK) angegebene Datei mit dem als Content-Type und contentType dem angegebenen fileDownloadName als vorgeschlagenen Dateinamen zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::VirtualFileResult ^ File(System::String ^ virtualPath, System::String ^ contentType, System::String ^ fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string? fileDownloadName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : string * string * string -> Microsoft.AspNetCore.Mvc.VirtualFileResult
override this.File : string * string * string -> Microsoft.AspNetCore.Mvc.VirtualFileResult
Public Overridable Function File (virtualPath As String, contentType As String, fileDownloadName As String) As VirtualFileResult

Parameter

virtualPath
String

Der virtuelle Pfad der zurückzugebenden Datei.

contentType
String

Der Inhaltstyp der Datei.

fileDownloadName
String

Der vorgeschlagene Dateiname.

Gibt zurück

Die für die Antwort erstellte VirtualFileResult .

Attribute

Gilt für:

File(Byte[], String, Nullable<DateTimeOffset>, EntityTagHeaderValue)

Gibt eine Datei mit dem angegebenen fileContents als Inhalt (Status200OK) und dem angegebenen contentType als Content-Type zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileContentResult ^ File(cli::array <System::Byte> ^ fileContents, System::String ^ contentType, Nullable<DateTimeOffset> lastModified, Microsoft::Net::Http::Headers::EntityTagHeaderValue ^ entityTag);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, DateTimeOffset? lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : byte[] * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileContentResult
override this.File : byte[] * string * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Mvc.FileContentResult
Public Overridable Function File (fileContents As Byte(), contentType As String, lastModified As Nullable(Of DateTimeOffset), entityTag As EntityTagHeaderValue) As FileContentResult

Parameter

fileContents
Byte[]

Der Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

lastModified
Nullable<DateTimeOffset>

Der DateTimeOffset des Zeitpunkts der letzten Änderung der Datei.

entityTag
EntityTagHeaderValue

Die EntityTagHeaderValue der Datei zugeordnete.

Gibt zurück

Die für die Antwort erstellte FileContentResult .

Attribute

Gilt für:

File(Stream, String, Boolean)

Gibt eine Datei im angegebenen fileStream (Status200OK) mit dem als Content-Type angegebenen contentType zurück. Dies unterstützt Bereichsanforderungen (Status206PartialContent oder Status416RangeNotSatisfiable , wenn der Bereich nicht zufriedenstellend ist).

public:
 virtual Microsoft::AspNetCore::Mvc::FileStreamResult ^ File(System::IO::Stream ^ fileStream, System::String ^ contentType, bool enableRangeProcessing);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, bool enableRangeProcessing);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member File : System.IO.Stream * string * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
override this.File : System.IO.Stream * string * bool -> Microsoft.AspNetCore.Mvc.FileStreamResult
Public Overridable Function File (fileStream As Stream, contentType As String, enableRangeProcessing As Boolean) As FileStreamResult

Parameter

fileStream
Stream

Die Stream mit dem Inhalt der Datei.

contentType
String

Der Inhaltstyp der Datei.

enableRangeProcessing
Boolean

Legen Sie auf fest true , um die Verarbeitung von Bereichsanforderungen zu aktivieren.

Gibt zurück

Die für die Antwort erstellte FileStreamResult .

Attribute

Hinweise

Der fileStream Parameter wird verworfen, nachdem die Antwort gesendet wurde.

Gilt für: