Taal

HostedFileClientExtensions.UploadAsync Methode

Definitie

Uploadt een bestand of inhoud naar de gehoste bestandsservice.

Overloads

UploadAsync(IHostedFileClient, DataContent, HostedFileClientOptions, CancellationToken)

Bron:
HostedFileClientExtensions.cs

Uploadt inhoud van een DataContent.

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

Parameters

client
IHostedFileClient

De bestandsclient.

content
DataContent

De inhoud die moet worden geüpload.

options
HostedFileClientOptions

Opties voor het configureren van het uploaden.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen.

Retouren

Informatie over het geüploade bestand.

Uitzonderingen

content is null.

Van toepassing op

UploadAsync(IHostedFileClient, String, HostedFileClientOptions, CancellationToken)

Bron:
HostedFileClientExtensions.cs

Uploadt een bestand vanuit een lokaal bestandspad.

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

Parameters

client
IHostedFileClient

De bestandsclient.

filePath
String

Het pad naar het bestand dat moet worden geüpload.

options
HostedFileClientOptions

Opties voor het configureren van het uploaden.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen.

Retouren

Informatie over het geüploade bestand.

Uitzonderingen

filePath is null.

filePath is leeg.

Van toepassing op