FileClientUploadFileAsync Method
Uploads a file to the remote server and creates a
RemoteFile object.
Namespace: GenerativeAI.ClientsAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
public Task<RemoteFile> UploadFileAsync(
string filePath,
Action<double>? progressCallback = null,
CancellationToken cancellationToken = default
)
- filePath String
- The path to the file to upload.
- progressCallback ActionDouble (Optional)
- An optional callback to report the upload progress.
- cancellationToken CancellationToken (Optional)
- An optional token to cancel the upload operation.
TaskRemoteFileThe uploaded file's information as a
RemoteFile object.