Page 1 of 1
SFTP resume upload/download
Posted: Thu 19 Sep 2013 19:13
by gandalf
Hi,
Does ScSFTPClient support resume upload and download?
Regards.
Re: SFTP resume upload/download
Posted: Mon 23 Sep 2013 10:09
by Dimon
To implement resume of upload or download, you should do the following steps:
1. Establish SFTP connection using the TScSFTPClient.Initialize method.
2. Open a remote file by the OpenFile method.
3. Read the needed amount of data using the ReadFile method in loop until file download is completed.
4. If while reading the file data an exception is raised, keep the count of the read data.
5. After handling the exception you should start the downloading process again, but you should start reading data from the last part of unread data. For this you should pass the appropriate file offset in the ReadFile method as the FileOffset parameter.
Re: SFTP resume upload/download
Posted: Mon 23 Sep 2013 20:07
by gandalf
Thank you for the information.
Will try this out.
Re: SFTP resume upload/download
Posted: Tue 24 Sep 2013 08:54
by Dimon
If any questions come up, please contact me.