PHPackages                             mhe/silverstripe-download-codes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. mhe/silverstripe-download-codes

ActiveSilverstripe-vendormodule[File &amp; Storage](/categories/file-storage)

mhe/silverstripe-download-codes
===============================

Create download codes for protected files in SilverStripe

v2.0.0(5mo ago)27BSD-3-ClausePHPPHP ^8.3CI passing

Since Jan 10Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/martinheise/silverstripe-download-codes)[ Packagist](https://packagist.org/packages/mhe/silverstripe-download-codes)[ RSS](/packages/mhe-silverstripe-download-codes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (12)Used By (0)

SilverStripe Download Codes
===========================

[](#silverstripe-download-codes)

An extension for SilverStripe for generating download codes to give frontend users special access to protected files. A typical use case would be the download of digital music albums via codes provided with the LP version or sold separately.

Requirements
------------

[](#requirements)

Requires Silverstripe 6.x – for a version compatible with Silverstripe 5 see respective branch `5`

Installation and setup
----------------------

[](#installation-and-setup)

Install with composer:

```
composer require mhe/silverstripe-download-codes ^2.0

```

Perform `dev/build` task

Add a page of type “Download Page” to your site. This will provide a form where users can redeem their code. You might want to deactivate the “Show in menus” setting and only communicate the URL together with the download codes.

### Recommended extensions

[](#recommended-extensions)

These extensions will improve the experience, but are optional:

- [bummzack/sortablefile](https://packagist.org/packages/bummzack/sortablefile): Support for sortable UploadFields, to sort Download Package files
- [colymba/gridfield-bulk-editing-tools](https://packagist.org/packages/colymba/gridfield-bulk-editing-tools): Support for bulk actions in Admin area
- PHP with enabled [ext/zip](https://www.php.net/manual/en/book.zip.php): Providing download packages as zip

Usage and administration
------------------------

[](#usage-and-administration)

- see [User guide](docs/en/userguide.md)

Configuration
-------------

[](#configuration)

The following templates are included providing the basic funcionality. You can adjust them via a theme or project templates to adjust the layout to your needs.

### Templates

[](#templates)

- `Mhe/DownloadCodes/Model/Layout/DLPage_redeem.ss`: Layout of the DownloadPage containing the main code redemption form
- `Mhe/DownloadCodes/Model/Layout/DLPage.ss`: Displayed after successful entering of a valid code, containing the actual links to downloadable files

### Configuration options via Silverstripe YAML configuration

[](#configuration-options-via-silverstripe-yaml-configuration)

#### Mhe\\DownloadCodes\\Model\\DLCode

[](#mhedownloadcodesmodeldlcode)

- *autogenerate\_chars*: string containing valid characters for auto generated codes (default: "ABCDEFGHIJAKLMNOPQRSTUVWXYZ0123456789")
- *autogenerate\_length*: length of auto generated codes (default: 8)
- *strip\_whitespace*: if true strips whitespace from user input for codes (default: false)
- *case\_sensitive*: user’s code input needs to match the case of the valid code (default: true), otherwise matches case-insensitive
- *usage\_limit*: number of attempts a regular code can be redeemed (default: 5). The actual file download after redemption (in case of download problems etc) is not limited by this.

#### Mhe\\DownloadCodes\\Model\\DLRedemption

[](#mhedownloadcodesmodeldlredemption)

- *validity\_days*: number of days a code redemption with the unique URL part will be valid and can be used for download

Available Backend Permissions
-----------------------------

[](#available-backend-permissions)

- *Access to 'Download Codes' section*: view download codes and packages
- *Edit download packages*: create, edit, delete download packages
- *Edit download codes*: create, edit, delete download codes

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~152 days

Total

9

Last Release

172d ago

Major Versions

v1.0.4 → 5.x-dev2024-07-29

4.x-dev → 6.x-dev2025-11-20

PHP version history (2 changes)v1.0.0PHP ^8.0

6.x-devPHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/bdc925a420ee741e57764c199a926d0edb8dbcfe1f4528b2f0519c465461720e?d=identicon)[martinheise](/maintainers/martinheise)

---

Top Contributors

[![martinheise](https://avatars.githubusercontent.com/u/16256376?v=4)](https://github.com/martinheise "martinheise (9 commits)")

---

Tags

silverstripefilecmsdownloads

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mhe-silverstripe-download-codes/health.svg)

```
[![Health](https://phpackages.com/badges/mhe-silverstripe-download-codes/health.svg)](https://phpackages.com/packages/mhe-silverstripe-download-codes)
```

###  Alternatives

[bummzack/sortablefile

An extension for SilverStripe that adds sorting to UploadField.

70622.7k55](/packages/bummzack-sortablefile)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

46130.7k6](/packages/unclecheese-dropzone)[silverstripe/selectupload

Enables files to be uploaded into a user-designated folder

2779.1k1](/packages/silverstripe-selectupload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
