Covers the Orchard Core 4 Vue 3 Media Gallery and api/media Media API, including gallery views, upload limits, TUS resumable uploads, SignalR real-time updates, multi-instance deployments, and migration from legacy AJAX endpoints.
Ships in 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.
Read when SKILL.md points to them.
Orchard Core 4.0 rewrote the Media Library admin UI as a Vue 3 Media Gallery
backed by the Media API, minimal-API endpoints under api/media. The same
gallery powers the Media Library page, the media picker modal (media fields,
HTML/Markdown editors) and the media field gallery editor. For media storage,
profiles, permissions and image resizing see orchardcore-media.
| Feature ID | Purpose |
|---|---|
OrchardCore.Media | Gallery, Media API, picker. Always required. |
OrchardCore.Media.Tus | Resumable chunked uploads through the TUS protocol (/api/media/tus). |
OrchardCore.Media.SignalR | Real-time updates on the /hubs/media hub. Depends on OrchardCore.SignalR. |
OrchardCore.SignalR | Shared SignalR hosting, the signalr client resource and the SignalR policy. |
OrchardCore.SignalR.Redis | Redis backplane. Depends on OrchardCore.Redis. |
OrchardCore.SignalR.Azure | Azure SignalR Service backplane. |
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Media",
"OrchardCore.Media.Tus",
"OrchardCore.Media.SignalR"
],
"disable": []
}
]
}
Force the list view everywhere (Media Library, media picker modal, media field gallery editor) and hide the grid toggle and thumbnail size setting:
{
"OrchardCore": {
"Media": {
"DisableThumbnails": true
}
}
}
Media:MaxFileSize is enforced client-side (files over a positive limit are rejected before upload, in the gallery, pickers and HTML/Markdown editor integrations), by MediaSizeLimitAttribute (Kestrel MaxRequestBodySize and form MultipartBodyLengthLimit), and by TUS (MaxAllowedUploadSizeInBytesLong). The server stays authoritative.maxAllowedContentLength in web.config to at least MaxFileSize; a startup warning is logged on a mismatch.AllowedFileExtensions is enforced on both sides. Extensions in RestrictedFileExtensions (.css, .js, .svg by default) also require UploadRestrictedMedia. The gallery receives the effective list for the current user.AllowedExtensions only narrow the global list; they cannot make a restricted or disallowed extension uploadable.The Media API, the TUS endpoint and the media hub authenticate with exactly one
scheme, chosen in Settings → Media → API
(MediaApiSettings.AuthenticationScheme, permission ManageMediaApiSettings,
granted to Administrators). Changing it releases the shell so the MediaApi
policy is rebuilt.
| Scheme | Behavior |
|---|---|
Cookie (default) | Same-origin admin cookie. Mutating requests must carry the antiforgery token (RequestVerificationToken header or __RequestVerificationToken form field); failures return 400 Problem Details. Works out of the box. |
Bearer | Only Bearer tokens on the Api scheme. The gallery silently gets an OAuth2 authorization-code + PKCE token (hidden iframe, prompt=none) from the tenant's OpenID server, renews it, and sends it to API calls, Uppy/TUS uploads and SignalR. A 401 is retried once after renewal. Requires OrchardCore.OpenId.Validation. |
The media hub accepts both the application cookie and Api bearer tokens in
either mode.
Run the Media API — Bearer/PKCE recipe (MediaApiPkce) from
Tools → Recipes. It enables OrchardCore.OpenId.Management,
OrchardCore.OpenId.Server and OrchardCore.OpenId.Validation, sets
MediaApiSettings.AuthenticationScheme to Bearer, enables the
authorization-code flow with PKCE required, sets local token validation
(Tenant: "Default"), and registers the public media_gallery client. Before
running it, replace https://localhost:5001 with the tenant origin (keep the
/OrchardCore.Media/media-gallery-oidc-silent.html path, including any tenant
prefix), use the right tenant name, and make sure gallery users have roles
granting media permissions (the roles scope carries them into the token).
Switch only the scheme in your own recipe:
{
"steps": [
{
"name": "Settings",
"MediaApiSettings": {
"AuthenticationScheme": "Bearer"
}
}
]
}
The gallery SPA can run on its own origin. The first sign-in is an interactive redirect; renewal stays silent.
MediaApiPkce first, then Media API — Standalone external app (MediaApiStandalone). It enables OrchardCore.Cors with a default policy for the app origin (AllowCredentials: false), adds callback.html and silent-callback.html redirect URIs to media_gallery, and reloads the tenant. Replace https://media.example.com and https://localhost:5001; CORS origins have no path or trailing slash.MediaApiStandaloneLocalhost is the same for local development (app at http://localhost:5173, tenant at https://localhost:5001). Never use it in production.config.json next to the app's index.html:{
"orchardBaseUrl": "https://cms.example.com/",
"appBaseUrl": "https://media.example.com/",
"oidcClientId": "media_gallery",
"oidcScope": "openid email profile roles",
"signalrEnabled": false,
"maxFileSize": 30000000
}
Keep maxFileSize equal to the tenant's Media:MaxFileSize. Set
signalrEnabled to true only once CORS covers /hubs/media.
All endpoints require the MediaApi policy except localizations, and then
check MediaPermissions (ManageMedia, folder-scoped ManageMediaFolder,
UploadRestrictedMedia) in the handler. Errors are RFC 9457 Problem Details.
Simple parameters are query string values.
| Method and route | Parameters | Returns |
|---|---|---|
GET api/media/GetDirectoryTree | none | Folder tree (DirectoryTreeNodeDto) |
GET api/media/GetFolders | path, skip, take | PaginatedFoldersDto (Items, HasMore) |
GET api/media/GetDirectoryContent | path, extensions | DirectoryContentDto (Folders, Files) |
GET api/media/GetMediaItems | path, extensions | Files of a folder |
GET api/media/GetAllMediaItems | extensions | Every file |
GET api/media/GetMediaItem | path | One FileStoreEntryDto |
GET api/media/GetMediaFieldItems | paths (repeated) | Items selected in a media field |
GET api/media/GetPermittedStorage | none | PermittedStorageDto (Bytes, Text) |
GET api/media/localizations | none | Gallery strings (anonymous) |
POST api/media/Upload | path, extensions, multipart files | UploadFilesResultDto (per-file Error) |
POST api/media/CreateFolder | path, name | Created folder |
POST api/media/DeleteFolder | path | 200 |
POST api/media/DeleteMedia | path | 200 |
POST api/media/DeleteMediaList | JSON body, array of paths | 200 |
POST api/media/MoveMedia | oldPath, newPath (rename or move) | 200 |
POST api/media/MoveMediaList | JSON body { mediaNames, sourceFolder, targetFolder } | 200 |
POST api/media/CopyMedia | oldPath, newPath | Copied file |
GET api/media/TusFileInfo/{uploadId} | TUS only | Upload info |
/api/media/tus | TUS protocol | Resumable upload endpoint (TUS only) |
POST api/media/Upload reads the destination folder from the path query
parameter, then from the path multipart form field; send ?path= or omit
both to upload to the library root (Attached media field uploads go to their
temporary folder since this fix, not to the root).
MoveMedia, CopyMedia and uploads re-check the target extension against the
user's effective extension list. See references/media-api-examples.md for
calls from JavaScript and C#.
OrchardCore.Media.Tus)Media:MaxUploadChunkSize (100 MB by default; 5 MB when set to 0), can be paused and resumed from the upload toast, and resume after a network failure through fingerprints in the browser's local storage.Media:TemporaryFileLifetime (sliding).ITusTempStore. The default DiskTusTempStore writes to the TusUploads sub-directory of OrchardCore:TempDirectory:Path (tenant-scoped; see orchardcore-temp-file-storage).AzureBlobTusTempStore (staged block blobs) or S3TusTempStore (S3 multipart uploads) under a _tus-uploads prefix of the media container or bucket, so any instance can continue an upload.IDistributedCache and chunk locks use IDistributedLock, so enable OrchardCore.Redis.Cache and OrchardCore.Redis.Lock when several instances serve TUS requests.Replace the store in your own module:
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using OrchardCore.Media.Services;
using OrchardCore.Modules;
[RequireFeatures("OrchardCore.Media.Tus")]
public sealed class TusStoreStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.Replace(ServiceDescriptor.Singleton<ITusTempStore, MyTusTempStore>());
}
}
ITusTempStore members: CreateFileAsync, AppendDataAsync (stream and
PipeReader overloads, returning bytes written), DeleteFileAsync,
FileExistAsync, OpenReadStream, GetFileLength.
OrchardCore.Media.SignalR)MediaHub at /hubs/media. The MediaHub policy requires ManageMedia and accepts cookie or Api bearer authentication; headless clients sending access_token need OrchardCore.OpenId.Validation.SubscribePath(path) and UnsubscribePath(path) (folder-authorized) and receive MediaChanged messages with action values fileUploaded, fileDeleted, fileMoved, fileCopied, directoryCreated and directoryDeleted.{
"OrchardCore": {
"Redis": {
"Configuration": "your-redis-host:6379,password=...,ssl=true"
},
"SignalR": {
"Azure": {
"ConnectionString": "Endpoint=https://<service>.service.signalr.net;AccessKey=...;Version=1.0;",
"ApplicationName": "OrchardCore"
}
}
}
}
OrchardCore.SignalR.Redis reuses OrchardCore:Redis:Configuration and isolates each tenant on its own channel prefix.OrchardCore.SignalR.Azure reads OrchardCore:SignalR:Azure. ApplicationName is optional (default OrchardCore), must start with a letter and contain only letters, numbers and underscores; set a unique value when several deployments share one service. A tenant identifier is appended automatically.OrchardCore.SignalR, use routes.MapHub<T>() and HubOptions<T>; server-rendered pages load <script asp-name="signalr" at="Foot"></script>.| Component | Configure |
|---|---|
| SignalR backplane | OrchardCore.SignalR.Redis or OrchardCore.SignalR.Azure |
| TUS chunks | Shared OrchardCore:TempDirectory:Path (NFS, Azure Files, EFS), Azure/S3 media storage (ITusTempStore), or sticky sessions |
| TUS metadata and locks | OrchardCore.Redis.Cache and OrchardCore.Redis.Lock |
| Media files | Azure Blob, Amazon S3, or a shared filesystem (orchardcore-azure-media, orchardcore-amazon-s3-media) |
| Data Protection keys | OrchardCore.Redis.DataProtection or OrchardCore.DataProtection.Azure |
Sharing the Data Protection key ring is mandatory once you scale out: the admin
cookie, antiforgery tokens and the OpenID access tokens (Data Protection
format) are all encrypted with it, and per-instance keys surface as random
401 errors in the gallery. Sticky sessions keep TUS chunks on one instance
but lose the upload if that instance stops. Non-TUS uploads use one request per
file and are unaffected.
A single Redis instance can cover the backplane, keys, cache and locks:
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Redis",
"OrchardCore.Redis.Cache",
"OrchardCore.Redis.Lock",
"OrchardCore.Redis.DataProtection",
"OrchardCore.SignalR.Redis",
"OrchardCore.Media.SignalR",
"OrchardCore.Media.Tus"
],
"disable": []
}
]
}
AdminController AJAX actions were removed. Map custom scripts and themes to the Media API:
Admin/Media/GetFolders → GET api/media/GetFolders (paginated) or GET api/media/GetDirectoryTreeGetMediaItems, GetMediaItem → GET api/media/GetMediaItems, GET api/media/GetMediaItemUpload → POST api/media/UploadDeleteFolder, DeleteMedia, MoveMedia, CreateFolder → same names under POST api/media/DeleteMediaList → POST api/media/DeleteMediaList with a JSON array bodyMoveMediaList → POST api/media/MoveMediaList with a JSON object bodyMediaApplication → removed; the gallery is mounted by the Media Library page and the pickerAuthorization: Bearer instead.MediaOptions.TusTempPath was removed; set OrchardCore:TempDirectory:Path (TUS uses its TusUploads sub-directory).OrchardCore_Media configuration section to Media (the old name is deprecated but still read).Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, media-gallery, media-api, tus-upload, signalr, vue3
/orchardcore:orchardcore-media-galleryfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job