title: File downloaded using System.Net.FtpClient has different size than the source file
body: <p>Using System.Net.FtpClient (which is a library, not a native .NET component).</p>
  
  <p>I am trying to download files to local hard drive (in development environment, both the FTP server and destination local folder are on the same physical drive with different path).</p>
  
  <p>I have this code.</p>
  
  <pre><code>using (Stream inputStream = ftpClient.OpenRead(item.FullName, FtpDataType.Binary, 15))
  using (FileStream fileStream = File.Create(localFilePath))
  {
      try
      {
          //inputStream.Seek(0, SeekOrigin.Begin);
          inputStream.CopyTo(fileStream);
      }
      catch (Exception ex)
      {
      }
  }
  </code></pre>
  
  <p><strong>Problem:</strong> Downloaded files are not the same size as original files.</p>
  
  <p>Note that I have tried with example line <code>//inputStream.Seek(0, SeekOrigin.Begin);</code> commented because it threw exception</p>
  
  <blockquote>
    <p>"Operation is not valid due to the current state of the object."</p>
  </blockquote>
  
  <p>And I didn't find a solution for it. Maybe this is part of the problem.</p>