HostedFileClientExtensions.DownloadAsync Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Laddar ned en fil som refereras av en 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)
Parametrar
- client
- IHostedFileClient
Filklienten.
- hostedFile
- HostedFileContent
Den värdbaserade filreferensen.
- options
- HostedFileClientOptions
Alternativ för att konfigurera nedladdningen.
- cancellationToken
- CancellationToken
Övervaka CancellationToken för annulleringsbegäranden.
Returer
En HostedFileDownloadStream som innehåller filinnehållet.
Undantag
hostedFile är null.