Guides setup and use of the CrestApps Orchard Core Digital Downloads commerce module for selling ebooks/files with protected storage, download entitlements, and signed expiring links.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate accurate setup, recipes and extension guidance for the CrestApps Digital Downloads module, which keeps a product's files privately, grants them to buyers when an order is paid, and serves them through signed, expiring links.
CrestApps.OrchardCore.Downloads (or the CrestApps.OrchardCore.Cms.Core.Targets bundle) in the web/startup project.CrestApps.OrchardCore.Downloads. It depends on CrestApps.OrchardCore.Commerce, CrestApps.OrchardCore.Products, CrestApps.OrchardCore.Orders and OrchardCore.Contents. Selling also needs Carts and CrestApps.OrchardCore.Checkout with a payment provider (see orchardcore-products, orchardcore-checkout and orchardcore-payments).CrestApps.OrchardCore.Customers so a guest's Contact step asks for the email the links go to (see orchardcore-customers).IProtectedFileStore<DigitalDownloadFiles>, which no URL serves.OrchardCore.Antivirus.ClamAV to scan uploads. Uploads run through Orchard Core's FileCreationService and every IFileEventHandler (see orchardcore-file-upload-security and orchardcore-antivirus).orchardcore-orders and orchardcore-carts; the shared Commerce menu and storefront account by orchardcore-commerce.{ "steps": [...] }.sealed modifier, except View Models.| Item | Value |
|---|---|
| Feature ID | CrestApps.OrchardCore.Downloads |
| Content part | DigitalFilesPart (Files, DownloadLimit, LinkLifetimeDays) |
| File store | IProtectedFileStore<DigitalDownloadFiles> (CrestApps.OrchardCore.FileStorage: SaveAsync, FindAsync, OpenAsync, DeleteAsync, returning ProtectedFile), registered with services.AddProtectedFileArea<DigitalDownloadFiles>(DownloadsConstants.StoreFolder); area folder DigitalFiles/{fileId}/{fileName}, under App_Data/Sites/{tenant} by default or in Azure Blob Storage (below). IDigitalFileStore, DigitalFileStore and StoredDigitalFile were removed; stored files are unchanged |
| Entitlements | DownloadEntitlement in collection Downloads, DownloadEntitlementIndex |
| Service | DownloadService (GrantAsync, ListAsync, CreateUrlAsync, ResolveAsync, RecordDownloadAsync, RevokeOrderAsync, RevokeAsync, ResetAsync) |
| Site settings | DownloadSettings (group downloads, Settings > Commerce > Downloads): DownloadLimit 5, LinkLifetimeDays 30 |
| Order seams | DownloadOrderEventHandler (OrderLineGrantHandlerBase<DigitalFilesPart>), IOrderEmailSectionProvider, OrderDownloadsDisplayDriver |
| Permission | ManageDigitalDownloads ("Manage digital files and downloads"; Administrator, Store manager), also guards the settings group |
| Recipe step | DigitalFiles (needs OrchardCore.Recipes.Core) |
| Report | Downloads under Reports > Commerce and the Digital Downloads dashboard widget (with CrestApps.OrchardCore.Reports) |
| Report Builder | Downloads data source (Downloads) with DownloadEntitlements (ManageDigitalDownloads; file store ids and links never exposed); recipe DownloadsReportBuilderReports adds an editable copy to the Store group |
| Sample recipe | Digital downloads sample: a Digital Product type, two ebooks with PDFs, an Ebooks listing, coupons WELCOME10 and EBOOKS5 |
DigitalFilesPart.Files holds DigitalFile items (FileId, FileName, Size). DownloadLimit and LinkLifetimeDays override the site settings when set; 0 means no limit or links that never expire.
The part editor uploads each file straight to the store through POST /Admin/downloads/files/upload (up to 1 GB, ManageDigitalDownloads), then saving the product keeps the ids the store knows. GET /Admin/downloads/files/{fileId} opens a stored file for staff. Removing a file from a product does not delete it, so past orders keep their downloads.
When an IFileEventHandler refuses a file, or the scanner cannot be reached, nothing is kept and the upload answers 400 with the reason.
A scaled-out site (several App Service instances or containers) or a container without persistent App_Data must keep protected files in one shared store. Enable Protected Files - Azure Blob Storage (CrestApps.OrchardCore.ProtectedFiles.Azure, no dependencies, no admin screen): every protected file area (digital downloads, and Learning's packages, coursework, xAPI attachments, evidence and QTI feedback images) moves to one blob container, each area in a folder of its own below BasePath. Configure the CrestApps:ProtectedFiles:AzureBlobStorage shell section in the web project's appsettings.json:
{
"OrchardCore": {
"CrestApps": {
"ProtectedFiles": {
"AzureBlobStorage": {
"ConnectionString": "",
"ContainerName": "protected-files",
"BasePath": "{{ ShellSettings.Name }}",
"CreateContainer": true
}
}
}
}
}
| Setting | Notes |
|---|---|
ConnectionString, ContainerName | Required. Without either, the feature logs an error and files stay in App_Data. ContainerName supports Liquid (protected-files-{{ ShellSettings.Name }} for a container per tenant) |
BasePath | Optional folder in the container, Liquid supported; areas sit below it, such as Contoso/DigitalFiles |
CreateContainer | Default true: created at tenant start, without public access |
RemoveContainer, RemoveFilesFromBasePath | Remove the container, or only the BasePath contents (shared container), when the tenant is deleted |
Files already in App_Data are not moved: copy each area folder to the container first, keeping the layout (App_Data/Sites/Contoso/DigitalFiles/{id}/{file} becomes {BasePath}/DigitalFiles/{id}/{file}, AzCopy per area). Keep the container private: downloads are served only by /downloads/{token} after the entitlement check. A module's own area follows the tenant's storage automatically once registered with AddProtectedFileArea<TArea>(folder); ProtectedFileAreaStore (registered through AddTenantFileStore) is the seam to keep every area in another IFileStore.
DownloadOrderEventHandler derives from OrderLineGrantHandlerBase<DigitalFilesPart> (Orders.Core), which reads each line's files from the product version the order bought (IContentManager.GetPurchasedAsync(line)), so editing the product later does not change what a buyer gets:
DownloadService.GrantAsync(order) creates one entitlement per file of each line's product, from the product version that was bought, inside the checkout's unit of work so the confirmation email can carry the links. Granting again adds only what is missing.From the order's admin page, staff can Take back one file (DownloadsRevoke) or Give downloads back (DownloadsReset), which resets the count, extends the link by the site lifetime and restores a revoked right.
/downloads/{token} (route DigitalDownload). The token is the entitlement id protected with data protection purpose CrestApps.OrchardCore.Downloads.Link, so links can be shown again; validity is decided by the entitlement.POST, so mail link scanners never use up a download.RecordDownloadAsync counts under a lock per entitlement.410 (expired, used up, canceled or refunded), or 404 when it names nothing.Buyers see their links on their order page, in the confirmation email (Your downloads, through DownloadEmailSectionProvider) and on account/downloads (AccountDownloads).
Each file names its product and gives its bytes as Base64, or Text for a small text file, up to 10 MB. A product that already has a file of that name keeps it, so rerunning adds nothing. Place the step after the Content step that creates the products.
{
"steps": [
{
"name": "DigitalFiles",
"Files": [
{ "ProductId": "4dgtlprod0trailguide00000a", "FileName": "trail-field-guide.pdf", "Base64": "JVBERi0xLjQK..." },
{ "ProductId": "4dgtlprod0notes0000000000a", "FileName": "read-me.txt", "Text": "Thanks for buying." }
]
}
]
}
A product type for downloads uses ProductPart with product type Digital plus DigitalFilesPart. An order of digital products only has no shipping step.
IOrderEmailSectionProvider seam, as DownloadEmailSectionProvider does.OrderGrantHandlerBase, or OrderLineGrantHandlerBase<TPart> (implement GetGrantedLineIdsAsync, GrantLineAsync, RevokeLineAsync) when the grant comes from a product part; both handle paid, canceled and full-refund events.DownloadService to list or revoke an order's entitlements from custom code instead of writing to the Downloads collection.| Symptom | Check |
|---|---|
Upload answers 400 | An IFileEventHandler (antivirus) refused the file or the scanner is unreachable |
| No links in the confirmation email | The order must be paid; the product version bought must have files |
| Email links point to the wrong host | Set the site Base URL |
Link answers 410 | The entitlement expired, was used up, or the order was canceled or fully refunded. Use Give downloads back |
| Guest gets no links | Enable Customers so checkout collects the guest's email |
DigitalFiles step error | The product must exist (run after Content), bytes must be valid base64 and at most 10 MB |
| Files missing on some instances | Protected files are in each instance's App_Data; enable Protected Files - Azure Blob Storage and copy the existing files to the container |
| Azure feature on but files still local | ConnectionString or ContainerName missing; see the log |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-orchardcore:orchardcore-downloadsfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job