ImageEdit

Here is an example that demonstrates the use of a ImageEdit component.

Example

Drag a file to upload it

ImageEdit (Extended Properties)

This demonstrates the most common properties that are availabe to set on the ImageEdit.

Example
Readonly? Required? Disabled? Display Image?

Drag a file to upload it

File Upload Pre-Processing

If you have the need to pre-process files before they are saved to Dataverse, there is a way to hook into the upload process to allow for custom handling of the file.

// In your startup class call the following:
services.Configure<FileSaveOptions>(options => {
    // Files can be saved to a temporary folder on the server or to an in-memory stream.
    options.SaveMode = FileSaveMode.SaveToTemporaryFolder;

    // Specify your pre-process handler
    options.FileProcessorMethod = async (columnFileInfo) => {
        // Perform your processing here
        var mutatedFileData = SomeMethodToManipulateTheByteArray(columnFileInfo.FileInfo.Data)
        return new FileInfo { FileName="New File Name", Data=mutatedFileData};
    };
});

FileSaveOptions Class

Properties

Name
Type
Default
Description
FileProcessorMethodFunc<ColumnFileInfo, Task<FileInfo>>?
SaveModeFileSaveMode
SaveToTemporaryFolder

ColumnFileInfo Class

Properties

Name
Type
Default
Description
ColumnNamestring
FileInfoFileInfo
TableNamestring

FileInfo Class

Properties

Name
Type
Default
Description
FileDatabyte[]?
FileNamestring
FileSizeInByteslong
0

ImageEdit Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Child content of the component
ColumnNamestring
Column logical name to bind the editor to from the table record.
Descriptionstring?
Description to be displayed in the tooltip.
Disabledbool?
Should the editor be disabled.
DisplayImagebool
False
DisplayLabelWhenAvailablebool
True
Specifies whether to display a lable if available.
DisplayTooltipWhenAvailablebool
True
Specifies whether to display a tooltip if available.
DisplayValidationErrorMessagebool
True
Should a validation error message be displayed when the component fails validation?
IsVisiblebool
True
Is the editor visible.
Labelstring?
Text to be displayed as a label for the editor.
MaxFileSizeInByteslong?
Gets or sets the maximum size of a file to be uploaded (in bytes).
Default value is 10 MB or the value specified by the column metadata.
ReadOnlybool?
Should the editor be read-only.
Requiredbool?
Should the value be required.
ValueFileValue?
Value of the column.

Methods

Name
Parameters
Type
Description
GetValidationErrorsList<string>
Returns a collection of the current validation errors.