AgentSessionFiles.DownloadSessionFileAsync Method

Definition

Download a file from the session sandbox as a binary stream. Also return file as binary data.

public virtual System.Threading.Tasks.Task<BinaryData> DownloadSessionFileAsync(string agentName, string sessionId, string sessionStoragePath, string localPath, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadSessionFileAsync : string * string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
override this.DownloadSessionFileAsync : string * string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Overridable Function DownloadSessionFileAsync (agentName As String, sessionId As String, sessionStoragePath As String, localPath As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)

Parameters

agentName
String

The name of the agent.

sessionId
String

The session ID.

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

agentName, sessionId, localPath or sessionStoragePath is null.

agentName, sessionId, localPath or sessionStoragePath is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to