1

I were using WinSCP .NET assembly for file downloading. Now I needed to support file resume functionality.

For that what I have done is

var options = new TransferOptions();
options.ResumeSupport.State = TransferResumeSupportState.On;

And in my code for downloading I have done

 TransferOperationResult transferResult = session.GetFiles(
     _appSettings["SFTP_IncomingFileFolder"] + file.Folder + "/" + file.FileName,
     _appSettings["Local_IncomingFileFolder"] + file.Folder + "\\" + file.FileName +".filepart", false, options);
 transferResult.Check();

Now to check if file resume work I disconnect while downloading. Problem is that every time I now download it starts from zero instead of the place where it left.

Like for 100 MB file if local downloaded length is 30 MB. When I try to reconnect it starts from zero length.

1 Answer 1

2
  1. The .ResumeSupport works for SFTP only.

  2. It works only if you had that flag set already when downloading the first piece, so that the piece has .filepart extension (it should the be case though as the default is to do that for all files over 100 KB).

  3. The .filepart extension is added automatically. If you add one explicitly, WinSCP will look for .filepart.filepart. So do not add the extension yourself.

  4. The explicit resume is supported since WinSCP 5.9.
    Set the TransferOptions.OverwriteMode property to OverwriteMode.Resume.


Reference:


If this does not help, please enable logging (Session.SessionLogPath) and show us the log.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.