Custom Upload Flow
An upload wrapper allowing to add a server validator to the upload component to decide if the uploaded file is valid to be accepted
This add-on is a wrapper around the Vaadin Upload component that allows to add a server validator to decide if the uploaded file is valid to be accepted from the content point of view. If the validation fails, the respective file is marked with the validation error message on the client.
Using the server validation:
upload.addFileValidator((filename, mimeType) -> {
//do some server validation with the uploaded file and decide if the file is valid or not
... server validation check ...
return ValidationResult.error("File is of wrong template/format!");
});
Links
Compatibility
1.0.0 | |
---|---|
(24.4) | |
(24.3) | |
(24.2) | |
(24.1) | |
10-24 | Y |
-23 | Y |
-22 | Y |
-21 | Y |
-20 | Y |
-19 | Y |
-18 | Y |
-17 | Y |
-16 | Y |
-15 | Y |
-14 | Y |
-13 | Y |
-12 | Y |
-11 | Y |
-10 | Y |
(8.21) | |
(8.20) | |
(8.19) | |
(8.18) | |
(8.17) | |
(8.16) | |
(8.15) | |
(8.14) | |
(8.13) | |
(8.12) | |
(8.11) | |
(8.10) | |
(8.9) | |
(8.8) | |
(8.7) | |
(8.6) | |
(8.5) | |
(8.4) | |
(8.3) | |
(8.2) | |
(8.1) | |
(8.0) | |
(7.7) | |
(7.6) | |
(7.5) | |
(7.4) | |
(7.3) | |
(7.2) | |
(7.1) | |
(7.0) | |
(6.8) | |
(6.7) | |
(6.6) | |
(6.5) | |
(6.4) | |
(6.3) | |
(6.2) | |
(6.1) | |
(6.0) |
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Released
- 2018-11-12
- Maturity
- EXPERIMENTAL
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 10+
- Vaadin 11+
- Browser
- N/A
Custom Upload Flow - Vaadin Add-on Directory
An upload wrapper allowing to add a server validator to the upload component to decide if the uploaded file is valid to be acceptedThis add-on is a wrapper around the Vaadin Upload component that allows to add a server validator to decide if the uploaded file is valid to be accepted from the content point of view.
If the validation fails, the respective file is marked with the validation error message on the client.
Using the server validation:
```
upload.addFileValidator((filename, mimeType) -> {
//do some server validation with the uploaded file and decide if the file is valid or not
... server validation check ...
return ValidationResult.error("File is of wrong template/format!");
});
```
Source CodeOnline Demo