Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove file from collection after uploading #18

Open
lukejagodzinski opened this issue Aug 16, 2014 · 0 comments
Open

Remove file from collection after uploading #18

lukejagodzinski opened this issue Aug 16, 2014 · 0 comments

Comments

@lukejagodzinski
Copy link

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);
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant