HostedFileClientExtensions.UploadAsync Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Uploadt een bestand of inhoud naar de gehoste bestandsservice.
Overloads
| Naam | Description |
|---|---|
| UploadAsync(IHostedFileClient, DataContent, HostedFileClientOptions, CancellationToken) |
Uploadt inhoud van een DataContent. |
| UploadAsync(IHostedFileClient, String, HostedFileClientOptions, CancellationToken) |
Uploadt een bestand vanuit een lokaal bestandspad. |
UploadAsync(IHostedFileClient, DataContent, HostedFileClientOptions, CancellationToken)
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)
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.