Secure Downloads & Tracking
Introduction | Settings | How O3 Secures Downloads | Creating Download Links
Digital products are files which can be stored on a computer, such as software, graphics, ebooks etc. You can assign a file to a product in the Products Manager. O3 allows the automatic fulfillment of orders for digital products in 3 different ways:
- You can include the file as an attachment in the order confirmation email.
- You can sell a membership product which gives access to a page of downloads.
- You can provide secure download links - anywhere on your site or in emails.
The first two options have been covered in the manual pages on the Products, and Users.
The settings for downloads are found under 'Downloads' in the Settings Manager:
- Download Directory - This specifies where your digital product files are kept. It must be on the same filesystem as the website, preferably off the document root (i.e. 'files'). If automatic directory renaming is enabled - this will reflect the current directory name.
- Rename Directory - This is an integer. If 0 renaming is disabled. If 1 or more, the directory is renamed to a random name every X downloads.
- Download Limit - This is an integer specifying how many times a user can download a product they have purchased. If 0 unlimited downloads are allowed.
How O3 Secures Downloads
Only users who have purchased a product can download it. When the request for a download is received (i.e. someone clicks a download link) it does this:
- Check the user is logged in. If not give an error message.
- If logged in, check the user has bought the product. If not give an error message.
- If logged in and has bought, then number of times they have downloaded the file is checked against the download limit. If it's over the limit, give an error message
- If the download is allowed:
- Send the file to the browser
- Update the download counter
- Rename the download directory (if required)
O3 has 2 powerful features which protect your products from unauthorised downloads:
- The download directory name is never presented to the browser. It is not available anywhere whatsoever on the website, and when the download is made, it goes through a script. So even at the point of download, the directory is completely hidden.
- You can opt to rename the directory where downloads are stored (to a random name), automatically, every X downloads. This means that even if someone were to find the location of your downloads directory, in the time it takes to do that, it would have already moved. You can opt to rename the directory after every single download by setting Directory Rename to '1'.
Creating Download Links
You can create download links in 2 simple ways:
- Create a link to any O3 enabled page on your website containing the parameter: 'dl=ProductName'.
- Use the macro 'PR-DOWNLOAD-URL' in a link in the product's container. This is replaced by a link back to the same page, but with the download parameter set.
i.e. (in the container)
<a href='PR-DOWNLOAD-URL' title='Download PR-NAME'>PR-NAME Download</a>
These links will be automatically actioned by O3 - it just needs the dl parameter set.
You can display the number of downloads so far by putting this code in your HTML:
<? echo count_downloads(product, mode) ?>.
See the Functions page for details.
Versions, Upgrades & Notification
O3 does not specifically support versions because it's not really necessary. Even if you're distributing software there are simple methods to acheive this already built-in.
To provide your customers with free intra-version upgrades:
- Upload the new version of the file. (If it's name has changed ensure you update that in the Products Manager).
- Send out an email to all customers of that product (From the Users Manager) informing them of the new version. You can include a link to the product in the email of the form:
- If you have limited downloads enabled in the Settings, you should clear the download stats for that product (in the Products Manager).
To charge customers for inter-version upgrades you just create a new product (i.e. ProductV2) - then they can't access it unless they've bought it.