The FileSelector
control (View Component) provides a reusable file selection user interface for Nucleus extensions. It allows users to browse,
select, and preview files from the site's file system, supporting multiple file system providers, folder navigation, and permission checks.
Add a FileSelector control to your Razor view using code like this:
@await Component.InvokeAsync(typeof(Nucleus.ViewFeatures.Controls.FileSelector), new
{
file = Model.SelectedDocument.File,
propertyName = "SelectedDocument.File"
})
file | The currently selected file, or null if no file is selected. |
pattern | Regular expression to filter file names (optional). |
propertyName | Name of the view model property to bind the selected file to (default: "SelectedFile" ). |
selectAnotherActionName | Controller action name for "Select Another" (default: "SelectAnother" ). |
showSelectAnother | Specifies whether to show the "Select Another" button (default: true ). |
noFilesMessage | Message to display when no files are available (default: "(no files)" ). |
showImagePreview | Specifies whether to show an image preview for image files (default: false ). |