ControllerBase.File ControllerBase.File ControllerBase.File Method

Definition

Overloads

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

Returns the file specified by virtualPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file in the specified fileStream (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns the file specified by virtualPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file in the specified fileStream (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file in the specified fileStream (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(String, String, String, Boolean) File(String, String, String, Boolean) File(String, String, String, Boolean)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns the file specified by virtualPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(Stream, String, String, Boolean) File(Stream, String, String, Boolean) File(Stream, String, String, Boolean)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns the file specified by virtualPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(String, String, String) File(String, String, String) File(String, String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(String, String, Boolean) File(String, String, Boolean) File(String, String, Boolean)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(Stream, String, String) File(Stream, String, String) File(Stream, String, String)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(Stream, String, Boolean) File(Stream, String, Boolean) File(Stream, String, Boolean)

Returns a file in the specified fileStream (Status200OK), with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(String, String) File(String, String) File(String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

File(Stream, String) File(Stream, String) File(Stream, String)

Returns a file in the specified fileStream (Status200OK), with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns a file in the specified fileStream (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

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

Returns the file specified by virtualPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file in the specified fileStream (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns the file specified by virtualPath (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

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

Returns a file in the specified fileStream (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

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

Returns a file in the specified fileStream (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type, and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

File(String, String, String, Boolean) File(String, String, String, Boolean) File(String, String, String, Boolean)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName, bool enableRangeProcessing);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns the file specified by virtualPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

File(Stream, String, String, Boolean) File(Stream, String, String, Boolean) File(Stream, String, String, Boolean)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName, bool enableRangeProcessing);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns the file specified by virtualPath (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag, bool enableRangeProcessing);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName, bool enableRangeProcessing);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

File(String, String, String) File(String, String, String) File(String, String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, string fileDownloadName);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

Returns

File(String, String, Boolean) File(String, String, Boolean) File(String, String, Boolean)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType, bool enableRangeProcessing);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

File(Stream, String, String) File(Stream, String, String) File(Stream, String, String)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, string fileDownloadName);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

Returns

File(Stream, String, Boolean) File(Stream, String, Boolean) File(Stream, String, Boolean)

Returns a file in the specified fileStream (Status200OK), with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, bool enableRangeProcessing);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, string fileDownloadName);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

fileDownloadName
String String String

The suggested file name.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType, bool enableRangeProcessing);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

enableRangeProcessing
Boolean Boolean Boolean

Set to true to enable range requests processing.

Returns

File(String, String) File(String, String) File(String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.VirtualFileResult File (string virtualPath, string contentType);
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
Parameters
virtualPath
String String String

The virtual path of the file to be returned.

contentType
String String String

The Content-Type of the file.

Returns

File(Stream, String) File(Stream, String) File(Stream, String)

Returns a file in the specified fileStream (Status200OK), with the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

Returns

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

Returns a file with the specified fileContents as content (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileContentResult File (byte[] fileContents, string contentType);
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
Parameters
fileContents
Byte[]

The file contents.

contentType
String String String

The Content-Type of the file.

Returns

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

Returns a file in the specified fileStream (Status200OK), and the specified contentType as the Content-Type. This supports range requests (Status206PartialContent or Status416RangeNotSatisfiable if the range is not satisfiable).

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.FileStreamResult File (System.IO.Stream fileStream, string contentType, Nullable<DateTimeOffset> lastModified, Microsoft.Net.Http.Headers.EntityTagHeaderValue entityTag);
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
Parameters
fileStream
Stream Stream Stream

The Stream with the contents of the file.

contentType
String String String

The Content-Type of the file.

lastModified
Nullable<DateTimeOffset>

The DateTimeOffset of when the file was last modified.

Returns

Applies to