Is collectionFS still the best File Upload handler for Meteor 1.7 and React?


#1

Hey guys,

I need to implement file uploads in several places.

  1. Avatar images for user profiles

  2. Photos users wish to share on their profile page

  3. Audio file uploads

I’m using React side wide instead of Blaze (not sure if that makes a difference, although the only docs I could find on collectionFS all seem to be relative to Blaze templates).

Is collectionFS still the best collection of packages to use for the above?

I only ask because, as a new Meteor user, it’s a bit overwhelming with so many different packages available, much simpler when you come from PHP as I do, and I don’t really know where to start. It concerns me that the collectionFS repo hasn’t been updated (other than package versions) in 3 years. Is this still safe to use with the current version of Meteor or are there other solutions that you could recommend?

Many thanks!


#2

Been looking at this one also, can any of you recommend it?


#3

I use cfs with react and AWS and it works great. Create your file stores just as described in the docs, then render an input element:

  render() {
    return (
      //...
        <input type="file" onChange={this.onFileInputChange.bind(this)}/>
      //...
    );
  }

and the input change handler like so:

  onFileInputChange(event) {
    FS.Utility.eachFile(event, file => {
      var fileId = CFSCollection.insert(file);
      // ... use fileId to create References 
    });
  }

I have never used ostrio:files but it looks neat as well!


#4

We’re using Meteor-Files in our app.
It’s got all the bells and whistles but also some quirks like the API is subtly different from a regular collection, and it’s hard to stub for unit tests

I think any package that does a bunch of work will have quirks that frustrate you, but on the core functions it’s solid


#5

Thanks for the replies and input guys. I ended up rolling my own file upload handler but will absolutely revisit these when I need to.