I use the VeliovGroup/Meteor-Files-plugin to upload files. After the upload I want to show the files directly.
I noticed that Meteor only allows the cursor of a FilesCollection to be send.
So I have a Meteor-call to get the link for my file. Is there some way to get the link in the data during the subscribe or is my meteor-call the only way to get the link to the client?
Ah, I got it!
I can not just return “Images.find()” like i would with a normal collection but rather this:
Meteor.publish('files.images.all', function () {
return Images.collection.find({});
});
or as I did before this:
Meteor.publish('files.images.all', function () {
return Images.find({}).cursor;
});
which works for the publish but it does not provide the link-function.
strange API, I’d not have expected that “Images” has a special collection-attribute that has a find as well as Images itself, or at least rename one of the two “find” methods to something else so it does not confuse the API user