0

I am trying to upload CSV files on the server using MemoryStream but some rows are missing. there are 242 rows and it's showing 136 rows after uploaded and the last row test is cut.

My code:

using (var client = new SftpClient(hostName, userName, new[] { privateKey }))
{
 client.Connect();
 if(client.IsConnected)
 {
   msData.Position = 0;
   client.BufferSize = uint.MaxValue;
   client.UploadFile(msData, string.Format("{0}{1}", filePath, fileName), null);
 }
}
  • Does this answer your question? [C# SFTP upload files](https://stackoverflow.com/questions/26700765/c-sharp-sftp-upload-files) – xdtTransform Nov 24 '20 at 13:58
  • And https://stackoverflow.com/questions/10871943/c-sharp-ftp-upload-buffer-size, https://stackoverflow.com/questions/3033771/file-i-o-with-streams-best-memory-buffer-size/3034155#3034155* for this buffersize – xdtTransform Nov 24 '20 at 14:03

0 Answers0