Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

How to: Provide a download button

David edited this page Apr 1, 2015 · 3 revisions

Create a helper that returns your files:

Template.fileList.helpers({
  files: function () {
    return Files.find();
  }
});

Use the url method with download option in your markup:

<template name="fileList">
  <div class="fileList">
    {{#each files}}
      <div class="file">
        <strong>{{this.name}}</strong> <a href="{{this.url download=true}}" class="btn btn-primary" target="_parent">Download</a>
      </div>
    {{/each}}
  </div>
</template>