SendFileResponseExtensions.SendFileAsync Method (IOwinResponse, String, Int64, Nullable<Int64>, CancellationToken)
Sends the given file using the SendFile extension.
Namespace: Microsoft.Owin
Assembly: Microsoft.Owin.StaticFiles (in Microsoft.Owin.StaticFiles.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function SendFileAsync ( _
response As IOwinResponse, _
fileName As String, _
offset As Long, _
count As Nullable(Of Long), _
cancellationToken As CancellationToken _
) As Task
'Usage
Dim response As IOwinResponse
Dim fileName As String
Dim offset As Long
Dim count As Nullable(Of Long)
Dim cancellationToken As CancellationToken
Dim returnValue As Task
returnValue = response.SendFileAsync(fileName, _
offset, count, cancellationToken)
public static Task SendFileAsync(
this IOwinResponse response,
string fileName,
long offset,
Nullable<long> count,
CancellationToken cancellationToken
)
[ExtensionAttribute]
public:
static Task^ SendFileAsync(
IOwinResponse^ response,
String^ fileName,
long long offset,
Nullable<long long> count,
CancellationToken cancellationToken
)
static member SendFileAsync :
response:IOwinResponse *
fileName:string *
offset:int64 *
count:Nullable<int64> *
cancellationToken:CancellationToken -> Task
public static function SendFileAsync(
response : IOwinResponse,
fileName : String,
offset : long,
count : Nullable<long>,
cancellationToken : CancellationToken
) : Task
Parameters
- response
Type: Microsoft.Owin.IOwinResponse
- fileName
Type: System.String
The full or relative path to the file.
- offset
Type: System.Int64
The offset in the file.
- count
Type: System.Nullable<Int64>
The number of types to send, or null to send the remainder of the file.
- cancellationToken
Type: System.Threading.CancellationToken
Return Value
Type: System.Threading.Tasks.Task
Returns Task.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IOwinResponse. When you use instance method syntax to call this method, omit the first parameter. For more information, see b8020aae-374d-46a9-bcb7-8cc2390b93b6 or 175ce3ff-9bbf-4e64-8421-faeb81a0bb51.