This plugin will return a signed URL used to allow temporary access to private objects with an expiring URL. You can optionally allow file downloads only for logged in users and force file downloads (useful for PDF files).
From the original developer, Jonathan Melville:
This plugin was originally developed for a client in the financial services industry who wanted to make sure only logged in users had access to downloads of financial reports, and download links couldn’t be shared. … Now you can keep your S3 objects private but grant temporary access to them with an expiring link.
S3 Secure Downloads is built for Craft v3.x. For a version that runs on Craft v2.5.x, see the original plugin.
# Require the plugin with composer
composer require kennethormandy/craft-s3securedownloads
# Install the plugin via the Control Panel, or by running:
./craft install/plugin s3securedownloads
Pass in an asset's entry id and it will return a signed URL for that asset:
<a href="{{ getSignedUrl(entry.myAssetField[0].id) }}">{{ entry.myAssetField[0].title }}</a>
Copyright © 2016–2019 Jonathan Melville
Copyright © 2019 Kenneth Ormandy Inc.