DEPRECATED
This basic upload field definition has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework.
For the updated implementation, see Upload field for Magnolia 6 UI instead.
BasicUploadFieldDefinition 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
fieldType: basicUpload
The basic upload field has three states. You can set properties for each.
- Empty is the starting point where no file has been selected. You can select a file with the button or drag it into the box.
- In progress displays a progress bar and incremental percentages and uploaded/total ratio.
- Completed displays a success notification and summary of file info.
Basic upload field properties
Simple basic upload field definition:
form: tabs: - name: tabUpload label: Upload fields: - name: upload fieldType: basicUpload label: Upload allowedMimeTypePattern: text/xml binaryNodeName: import
Node name | Value |
---|---|
form | |
tabs | |
tabUpload | |
fields | |
upload | |
allowedMimeTypePattern | text/xml |
binaryNodeName | import |
fieldType | basicUpload |
label | Import XML file |
| optional, default is Regular expression to filter allowed files by MIME type. For example, to allow images only, set the value to For more information about the supported pattern, see the |
| optional, default is Maximum file size in bytes. |
The following are label properties. Their values are typically retrieved from a message bundle.
Before upload | |
---|---|
| optional, default is translated Text displayed for the drop zone. |
| optional, default is translated Text displayed on the upload button. |
| optional, default is translated Text displayed when the upload is aborted. |
During upload | |
| optional, default is translated Text showing how many files have been uploaded. |
| optional, default is translated Text showing how many files have been uploaded in relation to the total number of files. |
After upload | |
| optional, default is translated Text displayed on the delete icon. |
| optional, default is translated Text displayed when an error occurs during the upload. |
| optional, default is translated Text displayed for the file format. |
| optional, default is translated Text displayed for the file header. |
| optional, default is translated Text displayed for the file name. |
| optional, default is translated Text displayed for the file size. |
| optional, default is translated Text displayed for the file source. |
| optional, default is translated Text displayed on the upload button. |
| optional, default is translated Text displayed when the file size is greater than |
| optional, default is translated Text displayed when the upload is successful. |
| optional, default is translated Text displayed when the file type is not set in |
| optional, default is translated Text displayed when the upload is interrupted. |
When using the basic upload field in a composite or multivalue field, use the DelegatingCompositeFieldTransformer. The other transformer classes do not work.