How would one handle a file upload with Meteor?

By : David

What would be the canonical way to handle a file upload with Meteor?

By : David


You can see on the meteor roadmap that the feature "File upload pattern" is scheduled for "After 1.0". So we have to wait to see an official way.

For now, one of the best ways is to use "collectionFS" (which is 0.3.x dev preview at the time of writting).

Or inkfilepicker (ex. as suggested here. It is easy enough to use, although this obviously requires and Internet connection from the user side.

If it just to play around, you could as well take advantage of the html5 feature. Something like that.

By : nha

To accomplish the same action as the most upvoted answer without the cost of, follow the instructions for this package:

Then to obtain the link, use code similar to below. Finally, plug the url returned by secureLink into the DB.{
  "click button.upload": function() {
    var files = $("input.file_bag")[0].files;
    S3.upload(files, "/subfolder", function(e,r) {
      Session.set('secureLink', r.secure_url);
  "files": function() {
    return S3.collection.find();

  "secureLink": function() {
    return Session.get('secureLink');
By : Sean L

here is yet another solution:

This one is using Blueimp's upload solution that supports chunked uploads, progress bars and more.

This video can help you solving your question :)
By: admin