Use Upload or Download overloads, that take remoteStartPosition parameter.
In most simple case you would use:
Ftp.Upload(string remotePath, byte[] data)
To upload data.
On error (exception) you should create new Ftp object and connect again.
Then use Ftp.GetFileSize(string remotePath) to check how much data was
transferred and invoke Upload method with remoteStartPosition parameter:
if (client.FileExists("GetFileSize.txt"))
{
long size = client.GetFileSize("file.txt");
client.Upload("file.txt", size, data);
}
- There are overloads that take stream as parameter.
- If your server supports checksum verification,
you can use Ftp.GetFileHash to verify hash of the uploaded data.