Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Event Listeners for different stages of file insert upload

Akhilesh Tyagi edited this page Dec 28, 2015 · 1 revision

These are the events that one can listen to on (SERVER side only) for keeping track of file insertion. This can be specifically handy in scenarios where you want to do some processing just after uploading the file to db.

filesCollection is an instance of FS.Collection.

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
});