Using Amazon S3 is a great service to store and manage files for video, audio, docs, spreadsheets, images, and quite honestly, really all of your files!
There may be some circumstances that you would like to provide some of these files to offer as a download to your members or paying customers, but they cannot be protected by the download library or shopping cart product.
There are three ways to add protection to a link.
- Access the Protected Link from the WYSIWYG Editor
- Generate the Download Link from the S3 File Manager
- Manually Add a CF Tag to a Page
Additionally, other attributes can be added for custom styling, validity time and link actions.
Why Protection is Necessary
When an unprotected file that is stored at Amazon S3 is offered, a member could easily share that link with friends and family or even strangers! They can post the link on their social media site or hotlink on their own website for anyone to use. This can cause problems for your site beyond just losing money from your now 'free' intellectual property.
Protecting a file is important as it may prevent copyright infringement. If your site includes copyrighted material, such as documents, images, or videos and those materials are shared without permission, it could result in copyright infringement lawsuits.
It is also important to maintain the integrity of your website: File sharing can lead to the spread of malware and other malicious content. This can damage your website's reputation and make it a less desirable destination for users.
How the Protection Works
An Amazon S3 link is only valid for a specific amount of time when the CF tag is used to add the link to your site. When a user clicks on the link from your site/page a unique access code will be created. After the set period of time that unique link will no longer work. so if it were shared, the next person would reach an inaccessible file.
Add Protected S3 Link Directly from WYSIWYG Editor
Adding or Editing a Page
The Amazon S3 tag can be added directly to a page while the page is being edited.
Click on the AWS Icon on the WYSIWYG menu
Simply find and click the file that you wish to add to the page. The CF tag will automatically be populated to the page where the cursor is blinking.
How to Protect from Link Sharing of Amazon S3 Files Using the S3 File Manager
S3 File Manager
Amazon S3 Files can be found under Utilities S3 File Manager
Generate the Download Tag
Right Click on the desired file and select 'Generate the Download Tag' from the menu.
This action will automatically COPY the cf tag to your clipboard.
Paste onto a Page
Open the page, department or portal page where the user will access the download link. Click the area in the content box where the download link should be located on the page and paste the tag (ctrl-v or command-v) from the clipboard.
Manually Add the CF Tag
Adding or Editing a Page
The Amazon S3 tag can be added directly to a page while the page is being edited.
Copy and Paste the Following CF Tag
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" text="Download Now!">
Update the Bucket Name and File Name
Customize the CF Tag for your file. Update the BUCKET_NAME to the bucket where the file is located, and update the FILE_NAME to the name of the file.
Enhancements and Customizations
There are a few ways to enhance and customize the cf tag to update the styling, text, or validity period. Mix and match to use the one or all of the attributes.
Custom Styling
Add one or more classes to the cf tag using class="CLASS_NAME(S)"
Substitute existing classes to CLASS_NAME(S)
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" text="Download Now!" class="CLASS_NAME(S)">
Example - Add a Button Class
<cf_s3download bucket="membergate_bucket" object="download_me.mp4" text="Download Now!" class="btn btn-primary">
Validity Time Period
Customize the number of minutes the link will be valid for using minutesValid="MINUTES". The default from Amazon S3 is 60 minutes.
Substitute the actual number of minutes for MINUTES
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" text="Download Now!" minutesValid="MINUTES">
Example - Set the Valid Period for 10 Minutes
<cf_s3download bucket="membergate_bucket" object="download_me.mp4" text="Download Now!" minutesValid="10">
Open the Link in a New Window
As with any other link, this one can be set to open in the same window (no action needed), or it can use the TARGET attribute to open in a new window using target="_blank" rel="noopener"
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" target="_blank" rel="noopener" text="Download Now!">
Example - Set the Link to Open in a New Window
<cf_s3download bucket="membergate_bucket" object="download_me.mp4" target="_blank" rel="noopener" text="Download Now!">
Download Now Text
Customize the text the user will see to inform them there is a download available by customizing the text="DOWNLOAD_NOW"
Substitute the text the user should see for DOWNLOAD_NOW
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" text="DOWNLOAD_NOW!">
Example - Set the Link Text to 'Save the File'
<cf_s3download bucket="membergate_bucket" object="download_me.mp4" text="Save the File">
Use them All!
As many of these enhancements and customizations can be used.
<cf_s3download bucket="BUCKET_NAME" object="FILE_NAME" text="Download Now!" class="CLASS_NAME(S)" minutesValid="MINUTES" target="_blank" rel="noopener">
Example - Include All Attributes
<cf_s3download bucket="membergate_bucket" object="download_me.mp4" text="Save the File" class="btn btn-primary" minutesValid="10" target="_blank" rel="noopener">
Visit MemberGate on Social Media!
Our social media sites (facebook, twitter and instagram) have become much more active as of late! Come visit us to follow or like or share with MemberGate! The latest features or reminders of older features, news, updates and tips and tricks will all be published on our social media pages. Stay updated with MemberGate!