SFTP resume upload/download

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
gandalf
Posts: 21
Joined: Mon 20 Feb 2012 17:43

SFTP resume upload/download

Post by gandalf » Thu 19 Sep 2013 19:13

Hi,

Does ScSFTPClient support resume upload and download?

Regards.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: SFTP resume upload/download

Post by Dimon » Mon 23 Sep 2013 10:09

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.

gandalf
Posts: 21
Joined: Mon 20 Feb 2012 17:43

Re: SFTP resume upload/download

Post by gandalf » Mon 23 Sep 2013 20:07

Thank you for the information.

Will try this out.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: SFTP resume upload/download

Post by Dimon » Tue 24 Sep 2013 08:54

If any questions come up, please contact me.

Post Reply