MODULES
Siteglide Modules
Media Downloads
9min
the media downloads module allows you to upload files securely you have control over who accesses the file, and how long links work for introduction the media downloads module is similar to file manager, but is designed to handle files which need to be handled more securely some examples might include files which exist behind a secure zone ebooks and other files you may need a subscription to access in it's first release, the module allows you to upload files securely it is not possible for internet users to "guess" the link to your files and download them generate secure links on the front end; each link will only be valid for a short amount of time after reloading the page this allows you to control who has access to the link, and how long they will have access for outputting list views on the front end like with other modules, you will use a liquid tag to output a list of module items on a page, page template, email or partial liquid file of your choice {% include 'module' id '17' layout 'default' per page '20' show pagination 'true' sort type 'properties name' sort order 'asc' %} you can use the following parameters id this must be set to 17 as this refers to the id of the media downloads module layout the layout folder containing the list layout per page how many items should be outputted on each page if more items are available than this, pagination controls will display show pagination if set to 'true' , pagination controls will display in the default position when more than one page of results is available sort type the field you'd like to sort by e g "properties name", or "created at" sort order choose asc for ascending values or desc for descending category ids pass in a string of comma separated ids of categories to filter the list so only items assigned to those categories can be displayed item ids control exactly which items can be displayed by passing in a string of comma separated ids you can find the items' ids in the admin expiry the number of seconds that the link is valid for after the page has finished loading default is 600 (10 minutes) note this is different from expiry date , see available fields media downloads layouts creating a layout file layouts can be created at the following path layouts/modules/module 17/my layout name/ developing a list layout you'll need to create a list folder in your layout folder and fill it with the following files wrapper liquid item liquid your wrapper liquid file should contain the following liquid which determines where the list of items will go {% include 'modules/siteglide media downloads/get/get items' item layout 'item' %} available fields in your item liquid file, you can use the following dynamic fields {{this id}} the item's unique id {{this name}} the item's name {{this create date}} the date this item was created use liquid date filters to format it {{this last edit date}} the date this item was last edited use liquid date filters to format it {{this file name}} the module automatically works out file name from the file itself {{this file type}} the module automatically works out file type by its extension {{this url}} this will output the temporary secure link see more details in the section below {{this weighting}} optional field used in sorting {{this release date}} the date this item was released use liquid date filters to format it {{this expiry date}} the date this item will expire use liquid date filters to format it note this is different from expiry see liquid parameters {{this category array}} an array of categories that the item is assigned to {{this description}} a description of the download {{this size in kb}} the file size of the download in kilobytes {{this size in mb}} the file size of the download in megabytes {{this size in gb}} the file size of the download in gigabytes how the media download links work when you output a link on the front end, it contains security parameters that will be different on every page load the purpose of these is to tie a security key with a time limited window to access the file the expiry parameter will be used to denote how long the link is valid for after the page has been loaded for example, if a user loads the page and then clicks the link 20 minutes later, the download link will already be invalid as it will be over the 10 minute default window at this point the user will have to reload the page to generate a new valid link despite this, you can use the link exactly like a normal url to an asset, except that there is no need to use asset url because the link goes directly to the cdn using media downloads with secure zones a secure link is only as secure as the page you output it on by outputting your layout on a page which is protected by a secure zone , you have full control over who will have access to your links you could also use categories to manage which media downloads are available on each secure zone a category could be created to correspond to each secure zone and on the secure page, you could output a list of media download items assigned to that category