CartThrob 9 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

Template Tags: Downloads

CartThrob supports protected file downloads for both free and purchased files.

You can use CartThrob download tags to hide file locations, generate member/role-restricted download access, and deliver files through form-based or link-based flows.

Download Delivery Tags

Use these tags as the main download entry points.

Form-based download

This is generally the most restrictive pattern because no reusable direct link is exposed in the page source. The download is submitted through a protected form/action flow.

  • download_file_form Generate a protected form submit that downloads a file through download_file_action.

Use this when you need a shareable URL (email/invoice/account pages). Access can still be restricted by member/role parameters.

  • get_download_link Generate an encrypted download URL for file delivery through download_file_action.

Legacy direct-download helpers

  • download_file Execute an immediate direct-download attempt from file/entry inputs (legacy helper).
  • view_download_link Build a legacy encrypted download path by appending encrypted segments to a template path.

Supporting Purchase Context Tags

These tags are commonly used with download tags to render purchased items and attach download buttons/links to each item:

Legacy/Code-Available Download Tags

These legacy download tags are code-supported and now documented:

  1. download_file
  2. view_download_link

These appear in legacy tutorial patterns (for example software-download examples). For new implementations, prefer download_file_form and get_download_link.

Notes and Constraints

  1. CartThrob download flows do not provide built-in IP tracking, time-expiry links, or download-count limits.
  2. If account credentials are shared, protected downloads may still be accessed by multiple users under that account.
  3. For high-control scenarios, add external safeguards (for example tighter account controls, role design, or additional download-governance tooling).