Skip to main content

ParallelModelBlobClient.DownloadToFileAsync method

Downloads a blob to a local file and returns the resolved destination path.

public Task<string> DownloadToFileAsync(Guid modelId, Guid blobId, string encryptionKey,
string destinationPath, TimeSpan? timeout = default,
CancellationToken cancellationToken = default)
parameterdescription
modelIdThe non-empty identifier of the model.
blobIdThe non-empty identifier of the blob.
encryptionKeyThe encryption key supplied with the blob request.
destinationPathThe local destination file path. Its parent directory must already exist.
timeoutThe optional timeout for the operation.
cancellationTokenThe token used to cancel the operation.

Return Value​

A task containing the absolute path to the downloaded file.

Exceptions​

exceptioncondition
ParallelModelConfigurationExceptionAn identifier is empty or the destination path is invalid.
ParallelModelFileTransferExceptionThe destination directory does not exist or a file system error prevents writing the blob.

Remarks​

The content is first written to a temporary file in the destination directory. An existing destination file is overwritten after the download succeeds.

See Also​