Can anyone help with utilities:avatar? here are my settings
Avatar.setOptions({
fallbackType: “initials”,
customImageProperty: ‘profile.profilePic’,
imageSizes : {
small : 35,
large : 100
}
});
my html template looks like this:
{{#with profileData}}
Name:
</div>
<!-- /.col-lg-7 -->
<div class="col-lg-5">
<div class="well well-lg">
{{> avatar user=this shape="circle"}}
<hr>
<div>
<input class='fileInput' type="file" id="file">
</div>
<hr>
<button type="button" class="js-af-remove-file">Remove image</button>
</div>
</div>
<!-- /.col-lg-5 -->
</div>
{{/with}}
and my template event looks like this
Template.user_profile.events = {
‘change .fileInput’: function () {
// var file = $(’#file’).get(0).files[0];
// fsFile = new FS.File(file);
// fsFile.metadata = {owner:Meteor.userId()}
// var fileObj = Images.insert(fsFile);
var file = $(’#file’).val();
// console.log('Upload result: ', fileObj);
//todo create meteor method call to update league with image (pass in fileObj).
Meteor.call(‘updateProfileImage’, file, function(error, success){
if(success){
console.log('profile image update was successful');
}
if(error){
console.log("profile image fail to update")
}
});
}
};
What is the best way to do this, should I be saving the url string from the input value or i’m missing another step?