Class UploaderTagHelper
Renders the main CoreUpload uploader UI and initializes the client-side uploader instance.
Use this Tag Helper for the full queue, progress, validation, chunking, and JavaScript API experience.
Inheritance
UploaderTagHelper
Assembly: CoreUpload.dll
Syntax
[HtmlTargetElement("core-upload")]
public class UploaderTagHelper : TagHelper, ITagHelper, ITagHelperComponent
Constructors
UploaderTagHelper(IOptions<CoreUploadOptions>, LicenseService)
Declaration
public UploaderTagHelper(IOptions<CoreUploadOptions> options, LicenseService licenseService)
Parameters
UploaderTagHelper(IOptions<CoreUploadOptions>, LicenseService, IAntiforgery?, IHttpContextAccessor?, IOptions<AntiforgeryOptions>?)
Antiforgery services are optional so a minimal-API host that never called
AddAntiforgery() still renders: asp-antiforgery then degrades to doing
nothing rather than throwing while a page is being rendered.
Declaration
public UploaderTagHelper(IOptions<CoreUploadOptions> options, LicenseService licenseService, IAntiforgery? antiforgery, IHttpContextAccessor? httpContextAccessor, IOptions<AntiforgeryOptions>? antiforgeryOptions)
Parameters
Properties
Antiforgery
Sends the ASP.NET Core antiforgery request token with every upload request, as the
header named by AntiforgeryOptions.HeaderName (default
RequestVerificationToken), and writes the companion cookie on this response.
This is the client half only. Make the endpoints actually validate it by setting
CoreUploadOptions.EnableAntiforgery; the two switches are independent.
Degrades to doing nothing - without throwing - if the host never registered
antiforgery services, if there is no HttpContext, or if HeaderName has
been set to null.
Declaration
[HtmlAttributeName("asp-antiforgery")]
public bool Antiforgery { get; set; }
Property Value
AutoOrient
Declaration
[HtmlAttributeName("asp-auto-orient")]
public bool AutoOrient { get; set; }
Property Value
AutoUpload
Gets or sets a value indicating whether files start uploading immediately after selection.
Declaration
[HtmlAttributeName("asp-auto-upload")]
public bool AutoUpload { get; set; }
Property Value
Declaration
[HtmlAttributeName("asp-browse-button")]
public string? BrowseButton { get; set; }
Property Value
Declaration
[HtmlAttributeName("asp-button-class")]
public string? ButtonClass { get; set; }
Property Value
ButtonText
Gets or sets the label shown on the default browse button.
Declaration
[HtmlAttributeName("asp-button-text")]
public string ButtonText { get; set; }
Property Value
ChunkCompleteUrl
Gets or sets the chunk-completion endpoint. Defaults to the chunk URL with
/complete appended, so overriding ChunkUrl moves this with it.
Declaration
[HtmlAttributeName("asp-chunk-complete-url")]
public string? ChunkCompleteUrl { get; set; }
Property Value
ChunkConcurrency
Gets or sets the number of chunks/parts uploaded in parallel for multipart strategies (chunked, s3, azure).
Declaration
[HtmlAttributeName("asp-chunk-concurrency")]
public int? ChunkConcurrency { get; set; }
Property Value
ChunkSize
Declaration
[HtmlAttributeName("asp-chunk-size")]
public int? ChunkSize { get; set; }
Property Value
ChunkUrl
Gets or sets the chunk endpoint. Defaults to {RoutePrefix}/chunk.
Declaration
[HtmlAttributeName("asp-chunk-url")]
public string? ChunkUrl { get; set; }
Property Value
Chunked
Gets or sets a value indicating whether chunked uploads are enabled.
Declaration
[HtmlAttributeName("asp-chunked")]
public bool Chunked { get; set; }
Property Value
ComputeHash
Gets or sets a value indicating whether a content hash is computed (in a Web Worker) for each file before upload.
Declaration
[HtmlAttributeName("asp-compute-hash")]
public bool ComputeHash { get; set; }
Property Value
Concurrent
Declaration
[HtmlAttributeName("asp-concurrent")]
public int? Concurrent { get; set; }
Property Value
Crop
Declaration
[HtmlAttributeName("asp-crop")]
public bool Crop { get; set; }
Property Value
CropAspectRatio
Declaration
[HtmlAttributeName("asp-crop-aspect-ratio")]
public string? CropAspectRatio { get; set; }
Property Value
CrossTab
Gets or sets a value indicating whether cross-tab upload coordination (via BroadcastChannel) is enabled.
Declaration
[HtmlAttributeName("asp-cross-tab")]
public bool CrossTab { get; set; }
Property Value
CrossTabChannel
Gets or sets the BroadcastChannel name used for cross-tab coordination. Namespaces coordination per application.
Declaration
[HtmlAttributeName("asp-cross-tab-channel")]
public string? CrossTabChannel { get; set; }
Property Value
DeleteUrl
Declaration
[HtmlAttributeName("asp-delete-url")]
public string? DeleteUrl { get; set; }
Property Value
DetectDuplicates
Declaration
[HtmlAttributeName("asp-detect-duplicates")]
public bool DetectDuplicates { get; set; }
Property Value
DirectorySelection
Declaration
[HtmlAttributeName("asp-directory")]
public bool DirectorySelection { get; set; }
Property Value
DropOverlay
Deprecated alias for asp-full-page-drop. Kept because it was already accepted;
setting it used to do nothing, even though asp-drop-overlay-text worked.
Declaration
[HtmlAttributeName("asp-drop-overlay")]
public bool DropOverlay { get; set; }
Property Value
DropOverlayText
Declaration
[HtmlAttributeName("asp-drop-overlay-text")]
public string? DropOverlayText { get; set; }
Property Value
DropTarget
Declaration
[HtmlAttributeName("asp-drop-target")]
public string? DropTarget { get; set; }
Property Value
DropZone
Declaration
[HtmlAttributeName("asp-drop-zone")]
public bool DropZone { get; set; }
Property Value
Extensions
Gets or sets the allowed file extensions for this uploader, using a comma-separated list.
Declaration
[HtmlAttributeName("asp-extensions")]
public string? Extensions { get; set; }
Property Value
FolderDrop
Deprecated alias for asp-directory. Kept because it was already accepted;
setting it used to do nothing at all.
Declaration
[HtmlAttributeName("asp-folder-drop")]
public bool FolderDrop { get; set; }
Property Value
FullPageDrop
Declaration
[HtmlAttributeName("asp-full-page-drop")]
public bool FullPageDrop { get; set; }
Property Value
Gallery
Declaration
[HtmlAttributeName("asp-gallery")]
public bool Gallery { get; set; }
Property Value
HashAlgorithm
Gets or sets the hashing algorithm used when asp-compute-hash is enabled (crc32 or sha256).
Declaration
[HtmlAttributeName("asp-hash-algorithm")]
public string? HashAlgorithm { get; set; }
Property Value
Declaration
[HtmlAttributeName("asp-hidden-input-id")]
public string? HiddenInputId { get; set; }
Property Value
Inline
Declaration
[HtmlAttributeName("asp-inline")]
public bool Inline { get; set; }
Property Value
KeyboardNavigation
Gets or sets a value indicating whether deep keyboard navigation of the upload queue
is enabled (roving tabindex, Arrow/Home/End focus movement, Delete/Enter row actions).
Enabled by default.
Declaration
[HtmlAttributeName("asp-keyboard-navigation")]
public bool KeyboardNavigation { get; set; }
Property Value
MaxCount
Declaration
[HtmlAttributeName("asp-max-count")]
public int? MaxCount { get; set; }
Property Value
MaxFiles
Gets or sets the maximum number of files that can be selected.
Declaration
[HtmlAttributeName("asp-max-files")]
public int? MaxFiles { get; set; }
Property Value
MaxHeight
Declaration
[HtmlAttributeName("asp-max-height")]
public int? MaxHeight { get; set; }
Property Value
MaxSize
Gets or sets the maximum allowed file size for this uploader, expressed as bytes or strings such as 10MB and 2GB.
Declaration
[HtmlAttributeName("asp-max-size")]
public string? MaxSize { get; set; }
Property Value
MaxWidth
Declaration
[HtmlAttributeName("asp-max-width")]
public int? MaxWidth { get; set; }
Property Value
Gets or sets the per-file editable metadata fields as a JSON array (e.g.
[{"id":"caption","label":"Caption"},{"id":"category","required":true}]).
Each field renders an inline input on PENDING/FAILED queue rows; required
fields block the file's upload until filled. Invalid JSON is ignored.
Declaration
[HtmlAttributeName("asp-meta-fields")]
public string? MetaFields { get; set; }
Property Value
MimeTypes
Gets or sets the allowed MIME types for this uploader, using a comma-separated list.
Declaration
[HtmlAttributeName("asp-mime-types")]
public string? MimeTypes { get; set; }
Property Value
MinHeight
Declaration
[HtmlAttributeName("asp-min-height")]
public int? MinHeight { get; set; }
Property Value
MinSize
Declaration
[HtmlAttributeName("asp-min-size")]
public string? MinSize { get; set; }
Property Value
MinWidth
Declaration
[HtmlAttributeName("asp-min-width")]
public int? MinWidth { get; set; }
Property Value
Multiple
Gets or sets a value indicating whether multiple file selection is allowed.
Declaration
[HtmlAttributeName("asp-multiple")]
public bool Multiple { get; set; }
Property Value
OnComplete
Declaration
[HtmlAttributeName("asp-on-complete")]
public string? OnComplete { get; set; }
Property Value
OnError
Declaration
[HtmlAttributeName("asp-on-error")]
public string? OnError { get; set; }
Property Value
OnProgress
Declaration
[HtmlAttributeName("asp-on-progress")]
public string? OnProgress { get; set; }
Property Value
OnRenditionCreated
Gets or sets the JavaScript callback invoked when a rendition file is generated
(receives (renditionTask, originalTask)).
Declaration
[HtmlAttributeName("asp-on-rendition-created")]
public string? OnRenditionCreated { get; set; }
Property Value
OnSelect
Declaration
[HtmlAttributeName("asp-on-select")]
public string? OnSelect { get; set; }
Property Value
OnTaskComplete
Declaration
[HtmlAttributeName("asp-on-task-complete")]
public string? OnTaskComplete { get; set; }
Property Value
OnTaskError
Declaration
[HtmlAttributeName("asp-on-task-error")]
public string? OnTaskError { get; set; }
Property Value
Paste
Declaration
[HtmlAttributeName("asp-paste")]
public bool Paste { get; set; }
Property Value
PersistAdapter
Gets or sets the client-side state persistence adapter (localStorage or indexeddb) used for resumable uploads.
Declaration
[HtmlAttributeName("asp-persist-adapter")]
public string? PersistAdapter { get; set; }
Property Value
PersistBlobs
Gets or sets a value indicating whether File blobs are persisted (requires indexeddb adapter) so uploads auto-resume after a reload without re-picking files.
Declaration
[HtmlAttributeName("asp-persist-blobs")]
public bool PersistBlobs { get; set; }
Property Value
PersistKey
Declaration
[HtmlAttributeName("asp-persist-key")]
public string? PersistKey { get; set; }
Property Value
PersistState
Declaration
[HtmlAttributeName("asp-persist-state")]
public bool PersistState { get; set; }
Property Value
PreloadedFiles
Declaration
[HtmlAttributeName("asp-preloaded-files")]
public string? PreloadedFiles { get; set; }
Property Value
PrioritizeFirstAndLastChunk
Gets or sets a value indicating whether chunk 0 and the final chunk upload before the
middle chunks, letting the server validate the file's head/tail (magic bytes, archive
directory) before most bytes are spent.
Declaration
[HtmlAttributeName("asp-prioritize-first-last-chunk")]
public bool PrioritizeFirstAndLastChunk { get; set; }
Property Value
RemoteSources
Gets or sets the remote import sources to render in the uploader chrome, as a comma-separated list (e.g. googledrive,dropbox,onedrive).
Declaration
[HtmlAttributeName("asp-remote-sources")]
public string? RemoteSources { get; set; }
Property Value
Renditions
Gets or sets the scaled renditions generated client-side alongside each image upload,
as a JSON array (e.g. [{"name":"thumb","maxSize":200},{"name":"medium","maxWidth":1024,"format":"image/webp","quality":0.8}]).
Each rendition uploads as its own file linked to the original via renditionOf.
Invalid JSON is ignored.
Declaration
[HtmlAttributeName("asp-renditions")]
public string? Renditions { get; set; }
Property Value
Declaration
[HtmlAttributeName("asp-resize-format")]
public string? ResizeFormat { get; set; }
Property Value
ResizeMaxHeight
Declaration
[HtmlAttributeName("asp-resize-max-height")]
public int? ResizeMaxHeight { get; set; }
Property Value
ResizeMaxWidth
Declaration
[HtmlAttributeName("asp-resize-max-width")]
public int? ResizeMaxWidth { get; set; }
Property Value
ResizeQuality
Declaration
[HtmlAttributeName("asp-resize-quality")]
public double? ResizeQuality { get; set; }
Property Value
Gets or sets the accessible name used when ButtonText is empty
(icon-only buttons). Ignored when the button has visible text.
Declaration
[HtmlAttributeName("asp-button-label")]
public string SelectButtonLabel { get; set; }
Property Value
ShowProgress
Declaration
[HtmlAttributeName("asp-progress")]
public bool ShowProgress { get; set; }
Property Value
ShowQueue
Declaration
[HtmlAttributeName("asp-queue")]
public bool ShowQueue { get; set; }
Property Value
ShowThumbnails
Declaration
[HtmlAttributeName("asp-thumbnails")]
public bool ShowThumbnails { get; set; }
Property Value
Sortable
Declaration
[HtmlAttributeName("asp-sortable")]
public bool Sortable { get; set; }
Property Value
Strategy
Gets or sets the upload strategy: auto, single, chunked, s3, azure, gcs, tus, or urlImport.
Declaration
[HtmlAttributeName("asp-strategy")]
public string? Strategy { get; set; }
Property Value
TusEndpoint
Gets or sets the tus endpoint URL. Defaults to {uploadUrl base}/tus when the tus strategy is used.
Declaration
[HtmlAttributeName("asp-tus-endpoint")]
public string? TusEndpoint { get; set; }
Property Value
UploadButtonText
Gets or sets the label shown on the manual upload (submit) button that appears when asp-auto-upload="false".
Declaration
[HtmlAttributeName("asp-upload-button-text")]
public string UploadButtonText { get; set; }
Property Value
UploadUrl
Declaration
[HtmlAttributeName("asp-upload-url")]
public string? UploadUrl { get; set; }
Property Value
WithCredentials
Declaration
[HtmlAttributeName("asp-with-credentials")]
public bool WithCredentials { get; set; }
Property Value
Methods
Process(TagHelperContext, TagHelperOutput)
Generates the uploader markup and startup script for the current page.
Declaration
public override void Process(TagHelperContext context, TagHelperOutput output)
Parameters
Overrides
Implements