title: Uploading files to FTP are corrupted once in destination
body: <p>I'm creating a simple drag-file-and-upload-automatically-to-ftp windows application </p>
  
  <p><img src="https://i.stack.imgur.com/M5kXP.png" alt="enter image description here"></p>
  
  <p>and I'm using the <a href="http://msdn.microsoft.com/en-us/library/ms229715.aspx" rel="noreferrer">MSDN code</a> to upload the file to the FTP.</p>
  
  <p>The code is pretty straight forward:</p>
  
  <pre><code>// Get the object used to communicate with the server.
  FtpWebRequest request = (FtpWebRequest)WebRequest.Create(String.Format("{0}{1}", FTP_PATH, filenameToUpload));
  request.Method = WebRequestMethods.Ftp.UploadFile;
  
  // Options
  request.UseBinary = true;
  request.UsePassive = false;
  
  // FTP Credentials
  request.Credentials = new NetworkCredential(FTP_USR, FTP_PWD);
  
  // Copy the contents of the file to the request stream.
  StreamReader sourceStream = new StreamReader(fileToUpload.FullName);
  byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
  sourceStream.Close();
  request.ContentLength = fileContents.Length;
  
  Stream requestStream = request.GetRequestStream();
  requestStream.Write(fileContents, 0, fileContents.Length);
  requestStream.Close();
  
  FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  writeOutput("Upload File Complete!");
  writeOutput("Status: " + response.StatusDescription);
  
  response.Close();
  </code></pre>
  
  <p>and <strong>it does</strong> get uploaded to the FTP</p>
  
  <p><img src="https://i.stack.imgur.com/gtgjD.png" alt="enter image description here"></p>
  
  <p><strong>Problem is</strong> when I see the file on a browser, or simply download and try to see it on desktop I get:</p>
  
  <p><img src="https://i.stack.imgur.com/QTg2a.png" alt="enter image description here"></p>
  
  <p>I already used <code>request.UseBinary = false;</code> and <code>request.UsePassive = false;</code> but it does not seam to do any kind of good whatsoever.</p>
  
  <p><strong>What I have found out</strong> was that, the original file has 122Kb lenght and in the FTP (and after downloading), it has 219Kb... </p>
  
  <blockquote>
    <p>What am I doing wrong?</p>
  </blockquote>
  
  <p>By the way, the <code>uploadFileToFTP()</code> method is running inside a <code>BackgroundWorker</code>, but I don't really thing that makes any difference...</p>