CollectionFS.on(stored, uploaded, error)


I am using CollectionFS to upload files from the client to the server Meteor is running on. After a file is successfully uploaded, I want to then do something. The documentation doesn’t make this clear but, according to issue #323, are a few ways to handle this:

filesCollection.on('stored', function (fileObj, storeName) {
  // do something
filesCollection.on('uploaded', function (fileObj) {
  // do something
filesCollection.on('error', function (error, fileObj) {
  // this will be an upload error; to listen for store errors, listen on the stores themselves

My questions are:

  1. Are these options currently available in CollectionFS?
  2. What is the difference between “stored” and “uploaded”?
  3. Is this the correct way to monitor when an upload is completed?