Skip to content

Remove file from collection after uploading #18

@lukejagodzinski

Description

@lukejagodzinski

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions