AgentSessionFiles.DownloadAsync(String, String, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Download a file from the session sandbox as a binary stream. Also return file as binary data.
public virtual System.Threading.Tasks.Task<BinaryData> DownloadAsync(string sessionStoragePath, string localPath, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
override this.DownloadAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Overridable Function DownloadAsync (sessionStoragePath As String, localPath As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)
Parameters
- sessionStoragePath
- String
The destination file path within the sandbox, relative to the session home directory.
- localPath
- String
The path to the local file to save the data to.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
localPath or sessionStoragePath is null.
localPath or sessionStoragePath is an empty string, and was expected to be non-empty.
Service returned a non-success status code.