sshnet / sshnet/SSH.NET

Continue Interrupted file uploads

Open
#660 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Hi,

I am in a situation where I am uploading large files via SFTP , and sometimes this gets interrupted. The next time I try I want to continue where it stopped. The provided SftpClient.UploadFile functionality did not have that option, so I wrote it using an SftpStream to write to. However the throughput of that was something like 4 to 5 times lower than a call to uploadfile.

So I ended up forking, and added a parameter "continueAbortedTransfer", to the
(Internal)UploadFile function. And a few lines of code at the start of the function to set
the stream positions correctly if the user wants to continue where it stopped the last time.

I have some questions:

  1. Is there an interest in this option, and should I try to prepare a pull request?
  2. Is the best way to add this? I know very little about the internals of this library,
    this was the first location that I found and it is just a couple of lines of code, but
    it could well be that there are better ways to add options like this, or that I broke
    some other code in the process.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing SftpClient.UploadFile and the internal UploadFile implementation, then compare it with the SftpStream approach described in the issue. Determine how interrupted transfers should resume while preserving existing upload behavior and throughput. Done means the option is clearly defined and resumable uploads work reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.