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 186
Requires Statamic 2

Erin Dalzell

More by Erin Dalzell

Similar Addons

See All
Metapod allows you to interact with metadata from pages specified by URL.

Metapod

by LionsMouth Digital in Tag
Metapod allows you to interact with metadata from pages specified by URL.
Protect your Statamic forms using Google's reCAPTCHA service.

Google reCAPTCHA

by Aryeh Raber in Forms, Integration, Spam, Tag
Protect your Statamic forms using Google's reCAPTCHA service.
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
Behold! Easily unleash the power of Laravel Mix's version functionality within your Statamic site!

Statamic Mix

by Ben Furfie in CSS, JavaScript, Tag, Utility
Behold! Easily unleash the power of Laravel Mix's version functionality within your Statamic site!