Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
renders a field to upload a file to a Magnolia JCR workspace.
The file is stored on the node of the current context of the form (within a dialog or subApp), which could be a content app item, a page or a component of a page.
class: info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition
The basic upload field has three states. You can set properties for each.
Simple basic upload field definition:
form: tabs: - name: tabUpload label: Upload fields: - name: upload class: info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition label: Upload allowedMimeTypePattern: text/xml binaryNodeName: import
Node name | Value |
---|---|
form | |
tabs | |
tabUpload | |
fields | |
upload | |
allowedMimeTypePattern | text/xml |
binaryNodeName | import |
class | info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition |
label | Import XML file |
You can use common field properties and the properties in the tables below in a basic upload field definition:
<field name> | required Name of the field. |
| optional, default is Regular expression to filter allowed files by their MIME type. For example, to allow only Excel files set the value to |
| optional, default is Name of the subnode that will contain the file binary and related information. |
| optional, default is When set to |
| optional, default is When set to |
| optional, default is Maximum file size in bytes. |
Caption properties. Values are typically retrieved from a message bundle.
<field name> | required Name of the field |
Empty view | |
| optional, default is Text displayed as tooltip on the upload button. |
| optional, default is Text displayed as label for dropping invitation. |
| optional, default is You have aborted the upload of your file Text displayed in the warning note. |
In progress view | |
| optional, default is Text displayed as title. |
| optional, default is Text displayed as file upload ratio. |
Completed view | |
| optional, default is Text displayed as file detail header. |
| optional, default is Text displayed as file name label. |
| optional, default is Text displayed as file size label. |
| optional, default is Text displayed as file format label. |
| optional, default is Text displayed as file source label. |
| optional, default is Text displayed as tooltip on the delete icon. |
| optional, default is Text displayed on the upload button. |
| optional, default is Text displayed in the success note. |
| optional, default is Text displayed in the error note. |
| optional, default is Text displayed in the warning when file size > |
| optional, default is Text displayed in the warning when file type not in |
| optional, default is Text displayed in the warning when the user interrupts the upload. |
When using the basic upload field in a composite or multivalue field use the DelegatingCompositeFieldTransformer. The other transformer classes do not work.