Skip to content

DownloadFile hangs after downloading file #1614

@mrlife

Description

@mrlife

In the following example, only the "Begin download" console log is written. It successfully downloads the file, but never moves beyond the line with DownloadFile. No errors are thrown, and nothing shows up using the new logging with LogLevel.Trace.

If I add a downloadCallback to DownloadFile, that is called, yet it still never moves forward from that line.

Any ideas what could be happening?

using var sftp = new SftpClient("host", 123, "username", "password"));
sftp.Connect();

using (var fileStream = File.Create(@"C:\target\local\path\file.zip"))
{
    Console.WriteLine("Begin download");
    sftp.DownloadFile("/source/remote/path/file.zip", fileStream);
    Console.WriteLine("End download");
}

Console.WriteLine("Done");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions