ControllerBase.File Método

Definición

Sobrecargas

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

Devuelve un archivo en el especificado fileStream ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(String, String, String, Boolean)

Devuelve el archivo especificado por ( ) con el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado como fileContents Status200OK nombre de archivo contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo en el especificado ( ), el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve el archivo especificado por virtualPath ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve el archivo especificado por ( ), el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado como fileContents Status200OK nombre de archivo contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo en el especificado ( ), el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve el archivo especificado por ( ), el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve el archivo especificado por virtualPath ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Stream, String, String, Boolean)

Devuelve un archivo en el especificado ( ) con el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(String, String)

Devuelve el archivo especificado por virtualPath ( ) con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado fileContents como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Byte[], String)

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Stream, String)

Devuelve un archivo en el especificado fileStream ( ), con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Byte[], String, Boolean)

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Byte[], String, String)

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado fileContents como el nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo en el especificado fileStream ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Stream, String, String)

Devuelve un archivo en el especificado ( ) con el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(String, String, Boolean)

Devuelve el archivo especificado por virtualPath ( ) con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(String, String, String)

Devuelve el archivo especificado por ( ) con el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

File(Stream, String, Boolean)

Devuelve un archivo en el especificado fileStream ( ), con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Devuelve un archivo en el especificado fileStream ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

File(String, String, String, Boolean)

Devuelve el archivo especificado por ( ) con el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado como fileContents Status200OK nombre de archivo contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo en el especificado ( ), el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

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

Devuelve el archivo especificado por virtualPath ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve el archivo especificado por ( ), el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado como fileContents Status200OK nombre de archivo contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo en el especificado ( ), el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

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

Devuelve el archivo especificado por ( ), el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve el archivo especificado por virtualPath ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

File(Stream, String, String, Boolean)

Devuelve un archivo en el especificado ( ) con el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

File(String, String)

Devuelve el archivo especificado por virtualPath ( ) con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado fileContents como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

File(Byte[], String)

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

File(Stream, String)

Devuelve un archivo en el especificado fileStream ( ), con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

File(Byte[], String, Boolean)

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

File(Byte[], String, String)

Devuelve un archivo con el especificado como contenido ( ), el especificado como Content-Type y el especificado fileContents como el nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo en el especificado fileStream ( ) y el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

File(Stream, String, String)

Devuelve un archivo en el especificado ( ) con el especificado como Content-Type y el especificado fileStream como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a

File(String, String, Boolean)

Devuelve el archivo especificado por virtualPath ( ) con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

File(String, String, String)

Devuelve el archivo especificado por ( ) con el especificado como Content-Type y el especificado virtualPath como nombre de archivo Status200OK contentType fileDownloadName sugerido. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

virtualPath
String

Ruta de acceso virtual del archivo que se va a devolver.

contentType
String

Content-Type del archivo.

fileDownloadName
String

Nombre de archivo sugerido.

Devoluciones

VirtualFileResult

el objeto creado VirtualFileResult para la respuesta.

Atributos

Se aplica a

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

Devuelve un archivo con el especificado como contenido ( ) y el especificado fileContents Status200OK como contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileContents
Byte[]

Contenido del archivo.

contentType
String

Content-Type del archivo.

lastModified
Nullable<DateTimeOffset>

de DateTimeOffset la última vez que se modificó el archivo.

entityTag
EntityTagHeaderValue

asociado EntityTagHeaderValue al archivo.

Devoluciones

FileContentResult

el objeto creado FileContentResult para la respuesta.

Atributos

Se aplica a

File(Stream, String, Boolean)

Devuelve un archivo en el especificado fileStream ( ), con el especificado como Status200OK contentType Content-Type. Esto admite solicitudes de intervalo ( Status206PartialContent o si el intervalo no es Status416RangeNotSatisfiable satisfiable).

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

Parámetros

fileStream
Stream

con Stream el contenido del archivo.

contentType
String

Content-Type del archivo.

enableRangeProcessing
Boolean

Establezca en true para habilitar el procesamiento de solicitudes de intervalo.

Devoluciones

FileStreamResult

el objeto creado FileStreamResult para la respuesta.

Atributos

Comentarios

El fileStream parámetro se elimina después de enviar la respuesta.

Se aplica a