This shortcode generates secure, expiring Amazon S3 links, with additional features, automation integration, and unique security enhancements.
Here is a simple example, showing a link to a file called “test.jpg”:
<a [memb_s3_link htmlattr=href profile="yourprofile" object="test.jpg"] >
Here is a simple example, showing a link to a file in a path, with spaces in the filename:
<a [memb_s3_link htmlattr=href profile="yourprofile" object="/my/path/this is test.jpg"] >
This is how the shortcode looks like with optional parameters:
<a [memb_s3_link htmlattr=href profile="memberium" require_login="yes" object="test.jpg" direct_link="no" expiring="5"] >
action_ids: List of ActionSet ID’s to run on click. Defaults to none. (Optional)
direct_link: Whether to link directly to S3 or not. Valid values are “no” and “yes”. Defaults to “no”. Set to “yes” if the inks give you an Error 414. (Optional)
expiring – The number of seconds before the link expires. Defaults to the value set in the profile. (Optional)
fus_ids: FUS ID’s to add/remove on click. Defaults to none. (Optional)
goals: Campaign Builder goal to achieve on click protocol. Defaults to none. (Optional)
htmlattr: HTML attribute to embed the generated value in. If blank no attribute is generated. (Optional)
protocol: Whether to use HTTP or HTTPS for the link that is generated. Valid values are “http” and “https”. Defaults to https. (Optional)
require_login: Whether or not to require that the user is logged in. Valid values are “no” and “yes”. Defaults to no. (Optional)
object: The name of the Amazon S3 Object to link to. The object includes the full path except for the bucket itself. (Required)
profile: Name of Amazon S3 Profile to use. (Optional)
tag_ids: tag ID’s to add/remove on click (Optional)
You can use links generated by [memb_s3_link] to provide secure download capability for your server. This helps protect your downloads against unauthorized downloading or deep linking. It cannot prevent your users from sharing your content, but it does make it more difficult.
Why Expiration Matters
Systems that provide secure S3 links are common, but most suffer from a major problem that limits how usable they are, or makes them unfriendly to your users. Amazon S3 expiring links work by limiting the amount of time that the link can be used from the moment that the page loads. If you set the expiration too low, then your users must act quickly to click the links before the timer runs out. If they click an expired link, it gives them an ugly, unhelpful error message.
Memberium solves this by generating the link when it’s clicked, meaning that your users can take their time reading your page content, and that they’ll never see an expired link error message.
If you set “direct_link” to yes, then this system is disabled, and the expiration timer will start from page load.
Buckets are the way that Amazon S3 organizes it’s servers. The bucket name does not include the path. Buckets are used to store collections of objects. Objects behave much like files.
Objects and Filenames
Objects are how Amazon S3 stores your files. Unlike an FTP server, files on S3 do not have paths, however, you can put the “path name” into the file name so that it looks like a path. Many S3 softwares will use this to simulate paths. When you put your object name into the shortcode its important to include the full object name including the “path”.
When naming objects, it’s helpful to avoid certain characters that can cause problems when encoding the link. We recommend you stick to space, underline, dash, letters and numbers. Characters such as &, <, > and quotes are especially troublesome as they have special meaning in HTML.
Setting It Up
If you turn on Advanced Options in Memberium, you will see an additional menu called “Remote Files”.
- Links can be made to expire immediately after you click, completely eliminating the problem of the user sitting on the page and clicking after the link expires.
- Links can be made to require that the user clicking the link is either a logged-in admin or ActiveCampaign user, So that even if someone shares the link before it expires, it won’t work unless the other person logs in.
- Links can be made so that when they’re clicked, they add/remove tags, run actionsets, and/or achieve goals: Know if they downloaded that PDF or not.
Note: When using this shortcode with the “Broken Link Checker” plugin, the link checker may corrupt your links and mark them as invalid.
Click here to read more about Remote Files.