ApiBaseUploadFileWithProgressAsync(String, String, ActionDouble, DictionaryString, String, CancellationToken) Method
Uploads a file to the specified URL with progress reporting.
Namespace: GenerativeAI.CoreAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
protected Task<string> UploadFileWithProgressAsync(
string url,
string filePath,
Action<double> progress,
Dictionary<string, string>? additionalHeaders = null,
CancellationToken cancellationToken = default
)
- url String
- The full URL of the API endpoint.
- filePath String
- The local path to the file to be uploaded.
- progress ActionDouble
- A callback function to report upload progress as a percentage.
- additionalHeaders DictionaryString, String (Optional)
- Optional. Additional headers to add to the request.
- cancellationToken CancellationToken (Optional)
- Token to propagate notification that the operation should be canceled.
TaskStringThe server's response as a string.