I have executed testing using Mac OSX sftp command and also WinSCP. It looks like the behaviour of WinSCP is different to Mac.
code is here:
class Program
{
static void Main(string[] args)
{
var server = new FileServer();
server.Bind(22, FileServerProtocol.Sftp);
server.Keys.Add(new SshPrivateKey("private.key", "test"));
server.Users.Add("WinSCP", "test", "C:/ftproot");
server.Users.Add("MacOSX", "test", "C:/ftproot");
server.FileUploaded += Server_FileUploaded;
server.LogWriter = new Rebex.FileLogWriter("C:/ftproot/log.txt", Rebex.LogLevel.Debug);
server.Start();
Console.ReadLine();
}
private static void Server_FileUploaded(object sender, FileTransferredEventArgs e)
{
File.AppendAllText("C:/ftproot/UploadLog.txt", $"{DateTime.Now.ToString("u")} COMPLETE BytesTransferred={e.BytesTransferred.ToString("#,##0")} Path='{e.Path}' User='{e.User.Name}'\r\n");
}
}
I have sent logs from above via email.
Thanks