Controller.File Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
File(Byte[], String) |
Erstellt anhand der Dateiinhalte und des Dateityp ein FileContentResult-Objekt. |
File(Stream, String) |
Erstellt anhand des Datenstromobjekts und des Inhaltstyps ein FileStreamResult-Objekt. |
File(String, String) |
Erstellt anhand des Dateinamens und des Inhaltstyps ein FilePathResult-Objekt. |
File(Byte[], String, String) |
Erstellt anhand der Dateiinhalte, des Inhaltstyps und des Zieldateinamens ein FileContentResult-Objekt. |
File(Stream, String, String) |
Erstellt anhand des Datenstromobjekts, des Inhaltstyps und des Zieldateinamens ein FileStreamResult-Objekt. |
File(String, String, String) |
Erstellt anhand des Dateinamens, des Inhaltstyps und des Namens des Dateidownloads ein FilePathResult-Objekt. |
File(Byte[], String)
Erstellt anhand der Dateiinhalte und des Dateityp ein FileContentResult-Objekt.
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
Parameter
- fileContents
- Byte[]
Der binäre Inhalt, der an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
Gibt zurück
Das Dateiinhalt-Ergebnisobjekt.
Gilt für:
File(Stream, String)
Erstellt anhand des Datenstromobjekts und des Inhaltstyps ein FileStreamResult-Objekt.
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
Parameter
- fileStream
- Stream
Der Stream, der an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
Gibt zurück
Das Dateiinhalt-Ergebnisobjekt.
Gilt für:
File(String, String)
Erstellt anhand des Dateinamens und des Inhaltstyps ein FilePathResult-Objekt.
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
Parameter
- fileName
- String
Der Pfad der Datei, die an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
Gibt zurück
Das Dateidatenstrom-Ergebnisobjekt.
Gilt für:
File(Byte[], String, String)
Erstellt anhand der Dateiinhalte, des Inhaltstyps und des Zieldateinamens ein FileContentResult-Objekt.
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
Parameter
- fileContents
- Byte[]
Der binäre Inhalt, der an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
- fileDownloadName
- String
Der Dateiname, der im Dateidownload-Dialogfeld verwendet werden soll, das im Browser angezeigt wird.
Gibt zurück
Das Dateiinhalt-Ergebnisobjekt.
Gilt für:
File(Stream, String, String)
Erstellt anhand des Datenstromobjekts, des Inhaltstyps und des Zieldateinamens ein FileStreamResult-Objekt.
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
Parameter
- fileStream
- Stream
Der Stream, der an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ)
- fileDownloadName
- String
Der Dateiname, der im Dateidownload-Dialogfeld verwendet werden soll, das im Browser angezeigt wird.
Gibt zurück
Das Dateidatenstrom-Ergebnisobjekt.
Gilt für:
File(String, String, String)
Erstellt anhand des Dateinamens, des Inhaltstyps und des Namens des Dateidownloads ein FilePathResult-Objekt.
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
Parameter
- fileName
- String
Der Pfad der Datei, die an die Antwort gesendet werden soll.
- contentType
- String
Der Inhaltstyp (MIME-Typ).
- fileDownloadName
- String
Der Dateiname, der im Dateidownload-Dialogfeld verwendet werden soll, das im Browser angezeigt wird.
Gibt zurück
Das Dateidatenstrom-Ergebnisobjekt.
Gilt für:
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für