tags:

views:

16

answers:

1

My ftp is truncating data. Using a different product we are able to change the tranmissions size and it works. But I can't figure out hwo to do it in .NET.

                // 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();  
A: 

Just a thought...Before closing your streams, try to Flush them to see if it helps. I'm not sure if changing your transmission size will really do anything.

Jeremy