How to get file url for specific store using collectionFS in meteor

217 Views Asked by At

How to get file url for specific store using collectionFS in meteor? I need to retrieve it in my onrendered code:

var url = Images.findOne(filesList[index].id).url();

This return me default store for Images, but in Images i have two store:

Images = new FS.Collection("images", {
  stores: [fullImage, previewImage],
  filter: {
    allow: {
      contentTypes: ['image/*']
    },
    onInvalid: function (message) {
      if (Meteor.isClient) {
        toastr.warning("Impossibile salvare l'immagine a causa di: " + message);
      } else {
        console.log(message);
      }
    }
  }
});

I need to retrieve previewImage, i cannot use tag code because i need to download it in background on the client..

1

There are 1 best solutions below

0
On

Just found a simple solution:

Images.findOne(filesList[index].id).url({store: 'preview'});