I’m having a problem to upload my profile image in my application, and I can’t figure out why.
I published to my images collection and subscribe to it and still nothing happens.
Here’s the javascript code:
'change .PicInput': function(evt, template){
FS.Utility.eachFile(evt, function(file){
Images.insert(file, function(err, fileObj){
if(err){
throw new error(err.reason, "danger", "growl-top-right")
}else{
var userId = Meteor.userId();
var imageURL = {
"profile.image": "cfs/files/images" + fileObj._id
};
Meteor.users.update(userId, {$set: imageURL});
}
})
});
}