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.
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 = "ftp.hostname.com", PortNumber = 21, UserName = "ABC@ftp.hostname.com", Password = "Test12" }; try { using (var session = new Session()) { session.Open(sessionOptions); var transferOptions = new TransferOptions { TransferMode = TransferMode.Binary }; var transferResult = session.GetFiles("/test-destination/*.*",@"C:\test\", false, transferOptions); transferResult.Check(); foreach (TransferEventArgs transfer in transferResult.Transfers) { Console.WriteLine("Uploaded file: " + transfer.FileName); } } } catch (Exception ex) { return false; }