This plugin checks/validates the max size of an file input field. The validation is handled on client side via Javascript. If the input file is greater than max. allowed size a Javascript alert is thrown and the file item is cleared.
- Import plugin file "dynamic_action_plugin_de_danielh_filesizechecker.sql" from source directory into your application
- (Optional) Deploy the CSS/JS file from "server" directory on your webserver and change the "File Prefix" to webservers folder.
The plugin settings are highly customizable and you can change:
- Max size (in byte) - Maximum allowed size of a file in Byte. Default is 1MB (1048576 bytes)
- File Input Item - Choose the file input item for this action
- Alert text - Alert text if the file size is greater than allowed max. size
- Alert type - Choose between simple JS alert or Apex 5 dialog window
- Alert Text (no Browser Support) - Alert text if the browser doesn´t support this feature.
Create a new Dynamic Action with event "on change" on your file input item. As action choose "Filesize Checker".