tags:

views:

12

answers:

0

I have a .NET 2.0 console app. I am writing out data to a dtl file to be ftp'ed to an AS/400 server.Each line have to 1786 bytes. If I open the file in notepad, each line is, in fact, 1786. However, when I ftp it, the guy on the other end is saying there is data bneing truncated. He can't give me any more info, but he seems to think that the lines are coming over to large. Is there some sort of default line size when ftp'ing or anything esle that might cause line sizes to be altered?

Here is my code:

                // FTP the file
            FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(ftpfullpath);
            ftp.Credentials = new NetworkCredential(user, pwd);

            ftp.KeepAlive = true;
            ftp.UseBinary = false;  //Use ascii.

            ftp.Method = WebRequestMethods.Ftp.UploadFile;

            FileStream fs = File.OpenRead(inputfilepath + ftpfileName);
            byte[] buffer = new byte[fs.Length];
            fs.Read(buffer, 0, buffer.Length);
            fs.Close();

            Stream ftpstream = ftp.GetRequestStream();
            ftpstream.Write(buffer, 0, buffer.Length);
            ftpstream.Close();