Skip to content

A Craft CMS plugin that returns a signed URL for assets stored in Amazon S3.

License

Notifications You must be signed in to change notification settings

AutoleagueX/s3securedownloads

 
 

Repository files navigation

S3 Secure Downloads plugin for Craft CMS

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). 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.

Craft introduced the ability to have private S3 assets in 2.6.2771. Now you can keep your S3 objects private but grant temporary access to them with an expiring link.

Alt text

Installation

To install S3 Secure Downloads, follow these steps:

  1. Download & unzip the file and place the s3securedownloads directory into your craft/plugins directory
  2. -OR- do a git clone [email protected]:jonathanmelville/s3securedownloads.git directly into your craft/plugins folder. You can then update it with git pull
  3. Install plugin in the Craft Control Panel under Settings > Plugins
  4. The plugin folder should be named s3securedownloads for Craft to see it. GitHub recently started appending -master (the branch name) to the name of the folder for zip file downloads.

S3 Secure Downloads works on Craft 2.5.x.

Usage

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>

S3 Secure Downloads Changelog

1.0.0 -- 2016.02.25

  • Initial release

Brought to you by Jonathan Melville

About

A Craft CMS plugin that returns a signed URL for assets stored in Amazon S3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 85.1%
  • HTML 10.3%
  • CSS 2.3%
  • JavaScript 2.3%