Partially csv file uploaded using SftpClient in C#

295 views Asked by At

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);
 }
}
0

There are 0 answers