HostedFileClientExtensions.DownloadAsync Método

Definição

Descarrega um ficheiro referenciado por um HostedFileContent.

public static System.Threading.Tasks.Task<Microsoft.Extensions.AI.HostedFileDownloadStream> DownloadAsync(this Microsoft.Extensions.AI.IHostedFileClient client, Microsoft.Extensions.AI.HostedFileContent hostedFile, Microsoft.Extensions.AI.HostedFileClientOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member DownloadAsync : Microsoft.Extensions.AI.IHostedFileClient * Microsoft.Extensions.AI.HostedFileContent * Microsoft.Extensions.AI.HostedFileClientOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.HostedFileDownloadStream>
<Extension()>
Public Function DownloadAsync (client As IHostedFileClient, hostedFile As HostedFileContent, Optional options As HostedFileClientOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HostedFileDownloadStream)

Parâmetros

client
IHostedFileClient

O cliente de ficheiros.

hostedFile
HostedFileContent

A referência do ficheiro alojado.

options
HostedFileClientOptions

Opções para configurar o download.

cancellationToken
CancellationToken

O CancellationToken para monitorizar pedidos de cancelamento.

Devoluções

A contendo HostedFileDownloadStream o conteúdo do ficheiro.

Exceções

hostedFile é null.

Aplica-se a