Freigeben über


HostedFileClientExtensions.DownloadAsDataContentAsync Methode

Definition

Lädt eine Datei herunter und gibt den Inhalt als gepuffert zurück DataContent.

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

Parameter

client
IHostedFileClient

Der Dateiclient.

fileId
String

Die ID der herunterzuladenden Datei.

options
HostedFileClientOptions

Optionen zum Konfigurieren des Downloads.

cancellationToken
CancellationToken

Der CancellationToken zu überwachende Monitor für Abbruchanforderungen.

Gibt zurück

Der Dateiinhalt als .DataContent

Ausnahmen

fileId ist null.

fileId ist leer oder Leerzeichen.

Hinweise

Mit dieser Methode wird der gesamte Dateiinhalt in den Arbeitsspeicher gepuffert. Bei großen Dateien sollten Sie die Verwendung DownloadAsync(String, HostedFileClientOptions, CancellationToken) und das Streaming direkt an das Ziel erwägen.

Gilt für: