Download

Download
Description

Make a file available to download only once per email address or only if the user is logged in.

NOTE: assets must be private (otherwise they are publicly accessible and can always be downloaded)

Installation

  1. Download and unzip
  2. Copy Downlaod folder to yoursite/site/addons

Configuration (optional)

  1. Visit yoursite.com/cp/addons/download/settings or CP > Configure > Addons > Download
  2. Pick the asset container (only private ones are shown)

Usage

By User

The {{ download }} tag will only allow the file to be downloaded if the user is logged in. Parameters:

  • file (required) - name of the file
  • container (optional) - container the file is in. If you leave it out, the one in the settings will be used.

Only Once

The {{ download:once }} tag will only allow the file to be downloaded once per email address. Parameters:

  • file (required) - name of the file
  • container (optional) - container the file is in. If you leave it out, the one in the settings will be used.
  • email (required) - email address allowed to download the file

Errors

Use the {{ download:errors }} the same way you would the {{ form:errors }}, i.e. as single tag or a tag pair.

For example:

{{ if {download:errors} }}
    {{ download:errors }}
        {{ value }}
    {{ /download:errors }}
{{ /if }}

Important Links
Details
Released July 5, 2019
Downloads 52
Requires Statamic 2

Erin Dalzell

More by Erin Dalzell

Similar Addons

See All
Easily edit content and manage your site from the front-end. $20

Admin Bar

by Hounder in Enhancement, Tag, Tool, Utility
Easily edit content and manage your site from the front-end.
Create iCal files so users can add events to their calendar

iCal

by Erin Dalzell in Dates, Tag
Create iCal files so users can add events to their calendar