How to output the image i uploaded using Meteor-Files?

i use this to upload the file but i dont have a clue on how to render it using image tag…



  {{> renderImage}}
  {{> uploadForm}}

<template name="uploadForm">
  {{#with currentUpload}}
    Uploading <b>{{}}</b>:
    <span id="progress">{{progress.get}}%</span>
    <input id="fileInput" type="file" />

<template name="renderImage">
	<img src="{{myImage}}" alt="">


import { FilesCollection } from 'meteor/ostrio:files';

const Images = new FilesCollection({
  collectionName: 'Images',
  allowClientCode: false, // Disallow remove files from Client
  onBeforeUpload(file) {
    // Allow upload files under 10MB, and only in png/jpg/jpeg formats
    if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
      return true;
    } else {
      return 'Please upload image, with size equal or less than 10MB';

if (Meteor.isClient) {

if (Meteor.isServer) {
  Meteor.publish('files.images.all', function () {
    return Images.find().cursor;

    return Images.find();

First your renderImage helper returns a cursor so in your “renderImage” template you have to iterate with #each, or for your test just use findOne and #with.
Then access to the image src with
Second if you want the full URL for use in src you can use link to create a downloadable link

    return Images.findOne({}).link();

I am using the same to upload the files.
I have “choices” collection which have each choice with image.
I have published the images file
pub.js (server side)

Meteor.publish(‘files.images.all’, function () {
return Images.find().cursor;


{{#each choices}}
{{> choice}}




getImage(id) {
return Images.findOne({_id:id}).link();

I get Exception in template helper: getImage.

What I want is I have to display all the choices with their image & names.
I have the choices collections with data schema like
{name:“some choice”, featured_image:{ _id:“KcLkabv2wPiSwLpm6” }}
I am trying to get the link of the image by passing the ID to image collection.

How can I achieve this?
Is my approach is wrong?

I am new to meteor.

which Exception ? please provide detailled exception information
Please use quotes to put your code in good shape when posting… otherwise it’s difficult to read …

Thank you for your concern. I’m sorry for my messy content. Will Improve on my next post.

I raised a new topic which is detailed & got solutions on my own itself.
Follow it here Viewing Uploaded image in meteor-files