Template.items.events({
'change .myFileInput': function (event, template) {
var files = event.target.files;
for (var i = 0, ln = files.length; i < ln; i++) {
var fileObj = Images.insert(files[i]);
Items.insert({
type: 'test',
image: fileObj._id
});
}
}
});
Template.item.helpers({
image: function () {
return Images.findOne(this.image)
}
});
@BlueXik I use 'stored' event (works at server side only):
Images.on('stored', function (file, storeName) {
Fiber(function () {
let url = file.url({store: storeName})
and file should be reactively update its urls after insert at client side:
Images.insert(newFile, (error, file) => {
// file.url({store: 'youStoreName'})
hey guys, is there a way of listing all the contents of a database of my app?
I have been building an app, all static. Haven’t created a single collection,
but I’m using some packages that I’m pretty sure are creating collections.
When I remove autopublish and deploy, the app crashes.
Do I need to set up subscriptions and publications manually for packages that use collections?