Create protected download link

The protected download link feature is perfect to create signed URLsto any file type residing on AWS, so that the link cannot be shared elsewhere.

Open the article in which you want to place the link. Place the cursor where you want to it. This can be in between text or in a paragraph, a div, table, whatever.
We provide here two methods of working of which the wizard is the easiest. Select the method you want to use below:

Using the wizard

Click the Insert Footprint Player button in the article editor. This opens the Wizard popup. All we need to fill in there are:

  1. Title (title in shortcode)
  2. Media Type (mediatype in shortcode)
  3. Media File (mediafile in shortcode)
  4. Web distribution (bucket in shortcode)
  5. URL expiration (expireseconds in shortcode)

wizard protected download

Title is required because it is the hyperlink text. The title can contain any alphanumeric characters, including spaces. This is the only attribute that can contain spaces. For instance: Download my book. Don't place spaces anywhere else in the fields.

Media Type: Select Protected download link. or leave as is if it is already set in the Default settings.

Media File is the name of the file. When placed in a folder within the bucket, precede the filename by the folder path, like myfolder/mybook.pdf

Web distribution. Fill in the full path to the web distribution, like https://dxxxxx.cloudfront.net

URL expiration is required and it is a numerical value in seconds to create the signed URL, like expireseconds=600.
You can set this as a default in the Default settings if you only offer download links on your site. Otherwise, best set per item.

You should now have something like this:

wizard protected download2

Click Insert Shortcode. This places the shortcode at the point where you cursor is positioned, whether on its own line of within at text. It looks like this:

{footprint }title=Download my book|mediatype=link|mediafile=myfolder/mybook.pdf|bucket=https://dxxxxx.cloudfront.net|expireseconds=600{/footprint}

You can select the resulting shortcode and wrap it in a header (h1,h2,h3,...), a <div>, table, etc...(don't do this with video or audio shortcode).  The link tag is also customizable as it comes with class called signed-url. You can add a CSS style in the stylesheet of your template to format the link in any way you want. Example:

.signed-url a{text-decoration: none; color: red;margin:10px;border-radius:6px}
.signed-url a:hover{text-decoration: underline; color: #666;}


When you are done adapting the example shortcode, save the article.  Does the link work on the front end? Congratulations!

 

If not, check out Trouble shooting.
Once a shortcode works, you can copy it and simply adapt the title and mediafile.  

See also below for more info on shortcodes:

Working with shortcode

Note: in all shortcode examples on this site, there is a space after {footprint right before the end of the opening tag. This is to prevent the extension from showing a player on this site. Therefore, remove this space on your site if you copy the shortcode from here.

{footprint }....{/footprint}

The attributes you need are:

  1. mediatype
  2. title
  3. mediafile
  4. bucket
  5. expireseconds

Example shortcode

{footprint }mediatype=link|title=Dowload this file|mediafile=mybook.pdf|bucket=https://dxxxxx.cloudfront.net/expireseconds=600{/footprint}

mediatype=link 

title is required because it is the hyperlink text. For instance:

{footprint }mediatype=link|title=Download my book{/footprint}

When the shortcode is completed, this will result in: Download my book (but we are not finished yet). 
The title can contain any alphanumeric characters, including spaces. This is the only attribute that can contain spaces. Don't place spaces anywhere else in the shortcode.

mediafile is the full path to the file using a web distribution. When placed in a folder within the bucket, precede the filename by the folder path, like myfolder/mybook.pdf.  Thus we get sometihng like this:

{footprint }mediatype=link|title=Download my book|mediafile=mybook.pdf{/footprint}

 bucket is the web distribution. The tag bucket is somewhat misleading, it is an inheritance from S3Media Stream which could create expiring links for buckets as well as for web distributions. The same tag was and is used. Note that in Footprint Player, expiring links to buckets is deprecated, onyl web distributions are used, for security and performance. Fill in the full path to the web distribution:

{footprint }mediatype=link|title=Download my book|mediafile=mybook.pdf|bucket=https://dxxxxx.cloudfront.net|expireseconds=600{/footprint}

expireseconds is required and it is a numerical value in seconds to create the signed URL, like expireseconds=600.
You can set this as a default in the Default settings if you only offer download links on your site. Otherwise, best set per item.

{footprint }title=Download my book|mediatype=link|mediafile=https://dxxxxx.cloudfront.net/mybook.pdf|expireseconds=600{/footprint}

You can select the resulting shortcode and wrap it in a header (h1,h2,h3,...), a <div>, table, etc...(don't do this with video or audio shortcode).  The link tag is also customizable as it comes with class called signed-url. You can add a CSS style in the stylesheet of your template to format the link in any way you want. Example:

.signed-url a{text-decoration: none; color: red;margin:10px;border-radius:6px}
.signed-url a:hover{text-decoration: underline; color: #666;}

When you are done adapting the example shortcode, save the article.  Does the link work on the front end?  Congratulations!
If not, check out below:

Trouble shooting

Problems with shortcodes when pasting

Sometimes, the added code changes into a link.  if that happens, select the code and break the link because it can prevent the video from showing up since the editor added unwanted code. You recognize it when it looks somewhat like this:

{footprint }title=Download my book|mediatype=link|mediafile=mybook.pdf|bucket=https://dxxxxx.cloudfront.net|expireseconds=600{/footprint}

Remove any links within the short code without removing the short code itself.

Hidden formatting in shortcode

Sometimes when you copy and paste short codes from other documents,hidden formatting may be included. The link may not show up or only partial. Check the short code in Code view and remove any formatting.  Or select the shortcode and push the Remove formatting icon.

Access denied

You made a typo in the path to the file or you forgot to include expiringseconds.

You forgot to upload the file.

Another important consideration is that the expiring time is calculated according to your server.  If the time is off, the expiring will not happen on the dot. Try a higher value for expireseconds or better: ask the hosting company to check the clock on the server and correct it.

Invalid key or Unauthorized method

You use a private key file that is no longer valid.

The combination Private Key file and Keypair ID is incorrect. Check the Footprint Player component settings and compare with what you have on AWS in the Security Credentials section. You can also Run Analysis to find mistakes in the settings.  Run analysis will give a warning if the Private key file field doesn't contain the comments included in the private key file itself.