IHttpSendFileFeature Interface

Provides an efficient mechanism for transferring files from disk to the network.

Namespace
Microsoft.AspNetCore.Http.Features
Assemblies
  • Microsoft.AspNetCore.Http.Features

Syntax

public interface IHttpSendFileFeature
interface Microsoft.AspNetCore.Http.Features.IHttpSendFileFeature

Methods

SendFileAsync(System.String, System.Int64, System.Nullable<System.Int64>, System.Threading.CancellationToken)

Sends the requested file in the response body. This may bypass the IHttpResponseFeature.Body System.IO.Stream. A response may include multiple writes.

Arguments:
  • path (System.String) – The full disk path to the file.
  • offset (System.Int64) – The offset in the file to start at.
  • count (System.Nullable<System.Int64>) – The number of bytes to send, or null to send the remainder of the file.
  • cancellation (System.Threading.CancellationToken) – A System.Threading.CancellationToken used to abort the transmission.
Return type:

System.Threading.Tasks.Task

Task SendFileAsync(string path, long offset, long ? count, CancellationToken cancellation)