title: Mandrill / Java - Attached Files Corrupt
body: <p>I was trying to use the Mandrill Wrapper for Java to attached file in email. Here is my piece of code that is working on attachment files.</p>
  
  <pre><code>public byte[] attachmentContent(String filepath)
  {
      Path path = Paths.get(filepath);
      byte[] data = null;
      try {
          data = Files.readAllBytes(path);
      } catch (IOException e) {
          e.printStackTrace();
      }
      return data;
  }
  
      //adding attachment
      ArrayList&lt;MandrillAttachment&gt; attachedFiles = new ArrayList&lt;MandrillAttachment&gt;();
      //file 1
      String attType = "application/pdf";
      String attName = "Indian License.pdf";
      String attContent = Base64.encodeBase64URLSafeString(attachmentContent("C:\\LL Indian License.pdf"));
      System.out.println(attContent);
      //attach
      attachedFiles.add(new MandrillAttachment(attType, attName, attContent));
      message.setAttachments(attachedFiles);
  </code></pre>
  
  <p>However, the file keeps corrupted through the sending process. Any idea on how to fix this?</p>