Could you help me with this I am having the same problem. Here is my code.
using (SftpClient client = new SftpClient("172.17.1.5", "user", "password")){
client.Connect();
MemoryStream temp = new MemoryStream();
client.DownloadFile("Dir\\file.pdf, temp);
client.UploadFile(temp, "Dir\\downloadedfile\\filenew.pdf");
temp.Flush();
temp.Close();
fs.Flush();
fs.Close();
}