How to show error message on dropzone when file upload is not valid?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 10:08 PM
Hi Everybody,
When I set my nuxeo-dropzone element and restrict it to pdf file type, I want to be able to display an error message that it cannot load the file.
It fails silently if you upload a type that's not accepted.
Example,
<nuxeo-dropzone document="{{document}}" xpath="myDoc:myPath" label="File Example" accept=".pdf" required="true" ></nuxeo-dropzone>
Is it possible to catch the event and show an error message?
Thanks!
- 2019
- Development-Configuration
- error
- LTS2019
- Nuxeo
- Nuxeo-Core
- nuxeo-dropzone
- Nuxeo-Element
- nuxeo-elements
- nuxeo-js-client
- nuxeo-studio
- nuxeo-webui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2020 10:18 AM
Hello,
I've taken a look at the element (https://github.com/nuxeo/nuxeo-web-ui/blob/10.10/elements/nuxeo-dropzone/nuxeo-dropzone.html) and it seems we don't have a specific error message for the accepted format. So the best would be to update the error messages with something like File not uploaded. Make sure the file extension is correct
for https://github.com/nuxeo/nuxeo-web-ui/blob/10.10/i18n/messages.json#L504. I would also update the message
attribute to indicate clearly to the user the file extensions you're expecting (https://github.com/nuxeo/nuxeo-web-ui/blob/10.10/elements/nuxeo-dropzone/nuxeo-dropzone.html#L234).
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2020 02:00 PM
Thanks for your aswer, but I don't have the hoifix for solution problem, but a found a custom resolution.
Regards.
