What is the difference between SftpClient.UploadFile and SftpClient.WriteAllBytes?
I am observing some strange behaviour when I use SSH.NET to transfer files with SFTP. I am using SFTP to transfer XML files to another service (which I don't control) for processing. If I use SftpClient.WriteAllBytes the service complains the file is not valid XML. If I first write to a temporary file and then use SftpClient.UploadFile the transfer is successful. What's happening? Using .WriteAllBytes : public void Send(string remoteFilePath, byte[] contents) { using(var client = new SftpClient(new ConnectionInfo(/* username password etc.*/))) { client.Connect(); client.WriteAllBytes