You can use Ftp.Upload method overload, that takes remoteStartPosition parameter (REST command):
public FtpResponse Upload(
string remotePath,
long remoteStartPosition,
Stream source
)
...remember to seek the input stream to appropriate position before you start.
client.Upload("rest.txt", "this is ".ToByteArray());
client.Upload("rest.txt", 4, " is a test.".ToByteArray());
byte[] downloaded = client.Download("rest.txt");
Assert.AreEqual("this is a test.".ToByteArray(), downloaded);
Please note that server must support REST extension to support this method:
You can check the value of SupportsRestStream of Ftp.Extensions property to check if this method is supported by the remote server.
You can also use Ftp.Append (APPE command):
public FtpResponse Append(
string remotePath,
Stream source)
Here's the test:
client.Upload("append.txt", "this is ".ToByteArray());
client.Append("append.txt", "a test.".ToByteArray());
byte[] downloaded = client.Download(remotePath);
Assert.AreEqual("this is a test.".ToByteArray(), downloaded);