HostedFileClientExtensions.DownloadToAsync Methode

Definitie

Hiermee wordt een bestand gedownload en opgeslagen in een lokaal pad.

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

Parameters

client
IHostedFileClient

De bestandsclient.

fileId
String

De id van het bestand dat moet worden gedownload.

destinationPath
String

Het pad naar het bestand opslaan. Als het pad een map of leeg is, wordt de bestandsnaam afgeleid. Een leeg pad wordt behandeld als de huidige map.

options
HostedFileClientOptions

Opties voor het configureren van het downloaden.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen.

Retouren

Het werkelijke pad waar het bestand is opgeslagen.

Uitzonderingen

destinationPath is null.

fileId is leeg of witruimte.

Er bestaat al een bestand op het doelpad.

Van toepassing op