veliovgroup/Meteor-Files

onAfterUpload is missing context

Closed this issue · 3 comments

Hello,

I'm using Meteor 2.7.3 and ostrio:files 2.3.0. I'm very happy with it so far : thanks !

Once a file has been uploaded I need to push some data to another collection, to state that a file has been uploaded by one user.
I would like to use config.onAfterUpload for that purpose, but I'm missing the context with this.userId and this.user() as the other methods have (like config.onBeforeUpload for example).

Would it be possible to add it ?

Any other suggestion ?

I'm working on linux (Ubuntu),
this is a Server issue.

Regards
Kevin

@kmoyse-apizee userId should be available on the file's object/record

Hi @dr-dimitru ,
Yes you are right, userId is available on the fileRef object. With it I can get the user with:
const user = Meteor.users.findOne(fileRef.userId)
but, would it be more Meteor style to get it from context (this.user()) ?

would it be more Meteor style

this package has its own api with long history

Feel free to close it in case if the issue is solved on your end.