ControllerBase.File Metodo

Definizione

Overload

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

Restituisce il file specificato da virtualPath (Status200OK), l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file nell'oggetto specificato fileStream (Status200OK), specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK), l'oggetto specificato fileContents come Content-Type e l'oggetto specificato contentType come nome file suggeritofileDownloadName. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce il file specificato da virtualPath (Status200OK), l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce il file specificato da virtualPath (Status200OK) e l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file nell'oggetto specificato fileStream (Status200OK), specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file nell'oggetto specificato (Status200OK) e l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK), l'oggetto specificato fileContents come Content-Type e l'oggetto specificato contentType come nome file suggeritofileDownloadName. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(String, String, String, Boolean)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce il file specificato da virtualPath (Status200OK) e l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Stream, String, String, Boolean)

Restituisce un file nell'oggetto specificato () con l'oggetto specificato come Content-Type e l'oggetto specificato fileStreamcontentType come nome file suggeritofileDownloadName.Status200OK Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Stream, String)

Restituisce un file nell'oggetto specificato (Status200OK), con l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file con l'oggetto specificato fileContents come contenuto (Status200OK), specificato come Content-Type e l'oggetto specificato contentType come nome file suggerito fileDownloadName . Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Byte[], String)

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file nell'oggetto specificato (Status200OK) e l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Byte[], String, Boolean)

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Byte[], String, String)

Restituisce un file con l'oggetto specificato fileContents come contenuto (Status200OK), specificato come Content-Type e l'oggetto specificato contentType come nome file suggerito fileDownloadName . Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(String, String)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Stream, String, String)

Restituisce un file nell'oggetto specificato () con l'oggetto specificato come Content-Type e l'oggetto specificato fileStreamcontentType come nome file suggeritofileDownloadName.Status200OK Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(String, String, Boolean)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(String, String, String)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

File(Stream, String, Boolean)

Restituisce un file nell'oggetto specificato (Status200OK), con l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Restituisce il file specificato da virtualPath (Status200OK), l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

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

Restituisce un file nell'oggetto specificato fileStream (Status200OK), specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK), l'oggetto specificato fileContents come Content-Type e l'oggetto specificato contentType come nome file suggeritofileDownloadName. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

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

Restituisce il file specificato da virtualPath (Status200OK), l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

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

Restituisce il file specificato da virtualPath (Status200OK) e l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

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

Restituisce un file nell'oggetto specificato fileStream (Status200OK), specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

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

Restituisce un file nell'oggetto specificato (Status200OK) e l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK), l'oggetto specificato fileContents come Content-Type e l'oggetto specificato contentType come nome file suggeritofileDownloadName. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

File(String, String, String, Boolean)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

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

Restituisce il file specificato da virtualPath (Status200OK) e l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

File(Stream, String, String, Boolean)

Restituisce un file nell'oggetto specificato () con l'oggetto specificato come Content-Type e l'oggetto specificato fileStreamcontentType come nome file suggeritofileDownloadName.Status200OK Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

File(Stream, String)

Restituisce un file nell'oggetto specificato (Status200OK), con l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

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

Restituisce un file con l'oggetto specificato fileContents come contenuto (Status200OK), specificato come Content-Type e l'oggetto specificato contentType come nome file suggerito fileDownloadName . Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

File(Byte[], String)

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

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

Restituisce un file nell'oggetto specificato (Status200OK) e l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

File(Byte[], String, Boolean)

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

File(Byte[], String, String)

Restituisce un file con l'oggetto specificato fileContents come contenuto (Status200OK), specificato come Content-Type e l'oggetto specificato contentType come nome file suggerito fileDownloadName . Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

File(String, String)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

File(Stream, String, String)

Restituisce un file nell'oggetto specificato () con l'oggetto specificato come Content-Type e l'oggetto specificato fileStreamcontentType come nome file suggeritofileDownloadName.Status200OK Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a

File(String, String, Boolean)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato contentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

File(String, String, String)

Restituisce il file specificato da virtualPath (Status200OK) con l'oggetto specificato come Content-Type e l'oggetto specificato contentTypefileDownloadName come nome file suggerito. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

virtualPath
String

Percorso virtuale del file da restituire.

contentType
String

Tipo di contenuto del file.

fileDownloadName
String

Nome file suggerito.

Restituisce

Oggetto creato VirtualFileResult per la risposta.

Attributi

Si applica a

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

Restituisce un file con l'oggetto specificato come contenuto (Status200OK) e l'oggetto specificato fileContentscontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileContents
Byte[]

Contenuto del file.

contentType
String

Tipo di contenuto del file.

lastModified
Nullable<DateTimeOffset>

Oggetto DateTimeOffset di quando il file è stato modificato per l'ultima volta.

entityTag
EntityTagHeaderValue

Oggetto EntityTagHeaderValue associato al file.

Restituisce

Oggetto creato FileContentResult per la risposta.

Attributi

Si applica a

File(Stream, String, Boolean)

Restituisce un file nell'oggetto specificato (Status200OK), con l'oggetto specificato fileStreamcontentType come Content-Type. Supporta le richieste di intervallo (Status206PartialContent o Status416RangeNotSatisfiable se l'intervallo non è soddisfabile).

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

Parametri

fileStream
Stream

Oggetto Stream con il contenuto del file.

contentType
String

Tipo di contenuto del file.

enableRangeProcessing
Boolean

Impostare su per true abilitare l'elaborazione delle richieste di intervallo.

Restituisce

Oggetto creato FileStreamResult per la risposta.

Attributi

Commenti

Il fileStream parametro viene eliminato dopo l'invio della risposta.

Si applica a