meteor-file icon indicating copy to clipboard operation
meteor-file copied to clipboard

Remove file from collection after uploading

Open lukejagodzinski opened this issue 10 years ago • 0 comments

Hi, I've started using MeteorFile in my project and I was curious how to delete a file document from the collection after an upload is completed. After investigation I've noticed that there is (probably) no way to get to the collection from the file perspective or my custom template perspective. I had to add an event to the _meteorFileUploader template what I think is not a good solution. Could you provide some solution for this problem? Or could I write some code and create PR?

Template._meteorFileUploader.events({
  'click .remove': function (e, tmpl) {
    e.preventDefault();

    var uploader = tmpl.data,
        files = uploader.files;

    files.remove(this._id);
  }
});

lukejagodzinski avatar Aug 16 '14 18:08 lukejagodzinski