title: uploading large file using ftpwebrequest upload wont complete
body: <p>My software i designed uploads files using ftp to my sever I'm using the ftpwebrequest to do all uploading. When uploading a file 700mb it uploads about 500mbs then stops, it works fine when uploading smaller files the smaller files upload successfully but it just want work properly on large files. I have the uploading done in a background worker that reports the upload progress to a progress bar on the main client. When the background worker completes it executes the background worker completed function. The background worker completed function gets executed but the upload never completes and the progress bar is stuck at about 65 percent its like the client just stops uploading and executes the background worker completed function as though it completed uploading. What could be going wrong here the upload doesn't complete and the file dose not appear on the server here is the code that dose the uploading </p>
  
  <pre><code>void UploadFileInBackground_DoWork(object sender,DoWorkEventArgs e)
  {
          byte[] data;
          int packetsize = 1024 * 8;
  
          string Destination = UploadURI + cattext + "/" + ID + ".obj";
          string source = DialogBrower.FileName;
          FtpWebRequest request = (FtpWebRequest)WebRequest.Create(Destination);
          request.Credentials = new NetworkCredential("user", "pass");
          request.Method = WebRequestMethods.Ftp.UploadFile;
          request.UsePassive = true;
          request.UseBinary = true;
          request.KeepAlive = false;
          using (FileStream fs = new FileStream(source, FileMode.Open, FileAccess.Read))
          {
              try
              {
                  long filesize = fs.Length;
                  long sum = 0;
                  int count = 0;
                  data = new byte[packetsize];
                  Stream reqStream = request.GetRequestStream();
                  float totalpackits = filesize / packetsize;
                  float weightofpackit = 100 / totalpackits;
                  float percentage = 0;
                  while (sum &lt; filesize)
                  {
                      List&lt;string&gt; statusparms = new List&lt;string&gt;();
                      count = fs.Read(data, 0, packetsize);
                      reqStream.Write(data, 0, count);
                      sum += count;
                      percentage += weightofpackit;
                      int percentagetotal = Convert.ToInt32(Math.Round(percentage));
                      statusparms.Add(sum.ToString());
                      statusparms.Add(filesize.ToString());
                      UploadFileInBackground.ReportProgress(percentagetotal, statusparms);
                  }
                  reqStream.Close();
                  uploadedname = uploadingname;
              }
              finally
              {
                  fs.Dispose();
                  data = null;
              }
          }
  }
  </code></pre>