Search Results for

    Show / Hide Table of Contents
    View Source

    Class FileUploadPropertyEditor

    Defines the file upload property editor.

    Inheritance
    object
    DataEditor
    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    [DataEditor("Umbraco.UploadField", ValueEditorIsReusable = true)]
    public class FileUploadPropertyEditor : DataEditor, IDataEditor, IDiscoverable, IMediaUrlGenerator, IValueSchemaProvider

    Constructors

    View Source

    FileUploadPropertyEditor(IDataValueEditorFactory, IIOHelper)

    Initializes a new instance of the FileUploadPropertyEditor class.

    Declaration
    public FileUploadPropertyEditor(IDataValueEditorFactory dataValueEditorFactory, IIOHelper ioHelper)
    Parameters
    Type Name Description
    IDataValueEditorFactory dataValueEditorFactory

    Factory used to create data value editors for property values.

    IIOHelper ioHelper

    Helper used for IO operations such as file path resolution.

    Methods

    View Source

    CreateConfigurationEditor()

    Creates a configuration editor instance.

    Declaration
    protected override IConfigurationEditor CreateConfigurationEditor()
    Returns
    Type Description
    IConfigurationEditor
    View Source

    CreateValueEditor()

    Creates the corresponding property value editor.

    Declaration
    protected override IDataValueEditor CreateValueEditor()
    Returns
    Type Description
    IDataValueEditor

    The corresponding property value editor.

    View Source

    GetValueSchema(object?)

    Gets a JSON Schema (draft 2020-12) describing the incoming value structure.

    Declaration
    public JsonObject? GetValueSchema(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the schema.

    Returns
    Type Description
    JsonObject

    A System.Text.Json.Nodes.JsonObject containing a valid JSON Schema, or null if the schema cannot be generated for the given configuration.

    Remarks

    The returned schema should describe the structure that IDataValueEditor.FromEditor receives (i.e., what the Management API accepts).

    For configuration-dependent schemas (e.g., BlockList with specific element types), the schema should reflect the constraints defined in the configuration.

    View Source

    GetValueType(object?)

    Gets the CLR type that represents the incoming value structure.

    Declaration
    public Type? GetValueType(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the value type.

    Returns
    Type Description
    Type

    The CLR type of the incoming value, or null if the type cannot be determined or varies significantly based on configuration.

    Remarks

    For simple editors (e.g., textbox), this might return string. For complex editors (e.g., MediaPicker3), this returns the DTO type that the editor submits. For block-based editors where the structure is entirely configuration-dependent, this may return null.

    View Source

    TryGetMediaPath(string?, object?, out string)

    Tries to get a media path for a given property editor alias

    Declaration
    public bool TryGetMediaPath(string? propertyEditorAlias, object? value, out string mediaPath)
    Parameters
    Type Name Description
    string propertyEditorAlias

    The property editor alias

    object value

    The value of the property

    string mediaPath

    The media path

    Returns
    Type Description
    bool

    True if a media path was returned

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX