title: Meteor - Send email with attachment from an INPUT TYPE FILE
body: <p>I want to send an email when a form is submitted and one of the input is a type=file and I can't figure out how to attach this to the email. </p>
  
  <p>I'm working with Meteor and the package "email" from Meteor. I know this package is based on mailComposer and I have to provide some informations in an object. 
  But I don't know how to provide some of them since I don't want the file of the user to be uploaded on my server. 
  I think I need to get the path and the filename. Filename is easy but how to get the path ? </p>
  
  <p>I've tried it with FileReader but it created a "fake" path and it don't seem to work.</p>
  
  <p>This is Meteor method I call on server-side:</p>
  
  <pre><code> sendEmail: function (to, from, subject, text, attachments) {
    check([to, from, subject, text], [String]);
    this.unblock();
    Email.send({
      to: to,
      from: from,
      subject: subject,
      html: text,
      attachments: attachments
    });
  }
  </code></pre>
  
  <p>And here's the informations I provide on client-side: </p>
  
  <pre><code>readFile(inputResume.files[0], function(e) {
     var file = {
        filename: $(e.target).find('[name="resume"]')[0].files[0].name,
        path: e.target.result
     } 
  });    
  function readFile(file, onLoadCallback){
      var reader = new FileReader();
      reader.readAsDataURL(file);
      reader.onloadend = onLoadCallback;
  }
  Meteor.call('sendEmail',
    'email', // To
    'email', // From
    'subject', // Subject
    'text' // Message
    'file' // Attachment
  ); 
  </code></pre>
  
  <p>Thank you for the help!</p>