Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
The File Type Validator plugin validates uploaded files based on the configured list of allowed file types and their associated MIME types.
This plugin is created with the use of Apache Tika to validate the uploaded files.
This plugin source code is available in JogetOSS repository at https://github.com/jogetoss/file-type-validator.
Name | Description |
---|---|
Mandatory | When checked, field must be filled. |
Allowed File Types | Grid to hold File Type Name and MIME Type. |
File Type Name | Name of file type to uniquely identify the MIME Type. |
MIME Type | MIME Type based on the list of the link below. |
Reference | For the full list of file types and their MIME types, click here. |
Error Message to Show When Validation Fail | Custom error message to show when validation fail. |
1. Add a File Upload element into a Form
Figure 1: File Upload element in Form Builder
2. Under Advanced Options, choose the File Type Validator
Figure 2: File Type Validator Plugin Configurations
3. Fill in the necessary details. For the list of MIME types, please refer to Media Types (iana.org) which is under the Reference section. We can add multiple allowed file types.
4. Save and return to UI. Try to upload a file type which is allowed.
Figure 3: Uploading an allowed file type
Figure 4: Successfully uploaded
5. If you upload a file type which is not allowed, Invalid File Type(s) error will be shown.
Figure 5: Failed to upload a file type which is not allowed
6. If you upload a double file extension type, it will check the file magic number to perform validation
Figure 6: Failed to upload a double extension file