I am using an FtpClient.cs that someone else created and when I'm uploading (it uses a Socket) a file a carriage return is getting deleted when the file appears on the ftp location. Normally this wouldn't be a huge issue but this file is encrypted and by losing this byte it's unable to decrypt successfully.
Example of section where it errors out from original file (just file bytes):
E6C5C22DB57E0D0A78E5936259DCF4D8
Example of section where it errors after file is uploaded to ftp host(just file bytes)::
E6C5C22DB57E0A78E5936259DCF4D814
Here's the part of the upload code.
//input is a FileStream, bytes is an int, and buffer is a byte[], and cSocket
//is new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
//I debugged here and the values are correct in the buffer, but
//as soon as it sends the byte is getting removed.
while ((bytes = input.Read(buffer, 0, buffer.Length)) > 0)
{
cSocket.Send(buffer, bytes, 0);
}
My question is there a SocketFlag that will allow to not remove this particular carriage return, I couldn't see any when I'm glancing through socketflags...