HostedFileClientExtensions.DownloadAsync Método

Definición

Descarga un archivo al que hace referencia un 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

El cliente de archivos.

hostedFile
HostedFileContent

Referencia del archivo hospedado.

options
HostedFileClientOptions

Opciones para configurar la descarga.

cancellationToken
CancellationToken

que CancellationToken se va a supervisar para las solicitudes de cancelación.

Devoluciones

que HostedFileDownloadStream contiene el contenido del archivo.

Excepciones

hostedFile es null.

Se aplica a