Append Method

Append data from a local file; to a remote file using SFTP.

Syntax

public string Append();
Public Function Append() As String

Remarks

This method Appends the data from LocalFile to the RemoteFile. The StartTransfer, Transfer, and EndTransfer events provide details about the individual file transfers. If the LocalFile property is "" (empty string) then the file data will be available through the Transfer event.

This method returns an Operation Id which identifies the operation in progress. A corresponding SSHPlexOperation will also be added to the Operations collection. The operation can be canceled by passing the Operation Id to the CancelOperation method.

When the operation completes the AppendComplete event will fire, and the SSHPlexOperation associated with the completed operation will be removed from the Operations collection. Inspect the parameters of the AppendComplete event to determine the result.

If there is no SSH session in place, one is automatically created by the component first.

This method is only applicable when ChannelType is set to cstSftp.

Code Example


SSHPlexControl.Localfile = "C:\localfile.txt";
SSHPlexControl.RemoteFile = "remotefile.txt";
string operationId = SSHPlexControl.Append();

// Use Path in RemoteFile
SSHPlexControl.Localfile = "C:\localfile2.txt";
SSHPlexControl.RemoteFile = "folder/remotefile2.txt";
string operationId = SSHPlexControl.Append();

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 .NET Edition - Version 20.0 [Build 8501]