How to show error message on dropzone when file upload is not valid?

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!

0 votes

2 answers

189 views

ANSWER



Thanks for your aswer, but I don't have the hoifix for solution problem, but a found a custom resolution.

Regards.

0 votes



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

0 votes