cancel
Showing results for 
Search instead for 
Did you mean: 

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

Gabino_Reyes
Champ in-the-making
Champ in-the-making

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!

2 REPLIES 2

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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

Gabino_Reyes
Champ in-the-making
Champ in-the-making

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

Regards.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.