Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review

issue resolve

issue resolve by using generateurl code

Re: Need example of .NET Core 2.0 using FTP

You have a code for .NET Core 2.0 using FTP. If it does no work, we need full session log file showing the problem (using the latest version of WinSCP).

Also, can you login anyhow? Like using WinSCP GUI? If you can, post its log file too. Or have the GUI generate working code for you:

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Need example of .NET Core 2.0 using FTP

I have tried with below code with FTP but not work got error like require authentication before user command. I have use WinSCP nuget package latest version in ASP.NET Core 2.0.
Can you please share me one example of ASP.NET Core 2.0 using FTP not SFTP.
var sessionOptions = new SessionOptions
    Protocol = Protocol.Ftp,
    HostName = "",
    PortNumber = 21,
    UserName = "",
    Password = "Test12"
    using (var session = new Session())
        var transferOptions = new TransferOptions
            TransferMode = TransferMode.Binary
        var transferResult = session.GetFiles("/test-destination/*.*",@"C:\test\",
            false, transferOptions);
        foreach (TransferEventArgs transfer in transferResult.Transfers)
            Console.WriteLine("Uploaded file: " + transfer.FileName);
catch (Exception ex)
    return false;