Edit

Share via


BinaryData.FromFileAsync Method

Definition

Overloads

FromFileAsync(String, CancellationToken)

Creates a BinaryData instance from the specified file.

FromFileAsync(String, String, CancellationToken)

Creates a BinaryData instance from the specified file and sets MediaType to <see pref="mediaType"></see> value.

FromFileAsync(String, CancellationToken)

Source:
BinaryData.cs

Creates a BinaryData instance from the specified file.

public static System.Threading.Tasks.Task<BinaryData> FromFileAsync(string path, System.Threading.CancellationToken cancellationToken = default);
static member FromFileAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Shared Function FromFileAsync (path As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)

Parameters

path
String

The path to the file.

cancellationToken
CancellationToken

A token that can be used to cancel the operation.

Returns

A value representing all of the data from the file.

Applies to

FromFileAsync(String, String, CancellationToken)

Source:
BinaryData.cs

Creates a BinaryData instance from the specified file and sets MediaType to <see pref="mediaType"></see> value.

public static System.Threading.Tasks.Task<BinaryData> FromFileAsync(string path, string? mediaType, System.Threading.CancellationToken cancellationToken = default);
static member FromFileAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Shared Function FromFileAsync (path As String, mediaType As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)

Parameters

path
String

The path to the file.

mediaType
String

The MIME type of this data, for example, Octet.

cancellationToken
CancellationToken

A token that can be used to cancel the operation.

Returns

A value representing all of the data from the file.

See also

Applies to