title: Downloaded email attachment is not saved correctly using ImapX and C#
body: <p>I am writing a program in C# to access the UNREAD emails from Gmail using ImapX (Version 2.0.0.13). I wish to download specifically the powerpoint (.ppt or .pptx) files in the attachment. I have made the download of attachment work. </p>
  
  <p>However, the downloads are not saved correctly on the disk. For example, if an attachment is of size 3.5 MB only 2.4 MB of it is saved. </p>
  
  <p>Am I missing a step here?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>using(ImapClient client = new ImapClient(host, port, true, true))
  {
      if (client.Login(username, password))
      {
          FolderCollection folders = client.Folders;
          Message[] messages = client.Folders["INBOX"].Search("UNSEEN", MessageFetchMode.Attachments, 100);
  
          for (int i = 0; i &lt; messages.Length; i++)
          {
              if (messages[i].Attachments.Length &gt; 0)
              {
                  Attachment[] atts = messages[i].Attachments;
                  for (int j = 0; j &lt; atts.Length; j++)
                  {
                      if (atts[j].FileName.Contains("ppt") || atts[j].FileName.Contains("pptx"))
                      {
                          atts[j].Download();
                          atts[j].Save(SAVE_LOCATION, atts[j].FileName);
                      }
                  }
              }
          }
      }
  }
  </code></pre>