This is a migrated thread and some comments may be shown as answers.

Customize Upload message when file type is not supported

3 Answers 469 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raphael
Top achievements
Rank 1
Raphael asked on 20 Oct 2020, 12:19 PM

Is there a way to customize Upload's component error message when type of file that's submitted isn't allowed?

Key for the message is upload.invalidFileExtension, but I couldn't find a way to change it.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Oct 2020, 05:08 AM

Hello, Raphael,

This can be done by using the LocalizationProvider and passing the required key-value pair in the JSON:

https://www.telerik.com/kendo-react-ui/components/upload/globalization/

I made an example that modifies the invalid file message:

https://stackblitz.com/edit/react-ppmnhw?file=app%2Fbg.json

I hope this is helpful.

Regards,
Stefan
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Raphael
Top achievements
Rank 1
answered on 21 Oct 2020, 10:19 AM

Hi Stefan,

Thanks for the response. I've encountered another problem, I want to have a different custom message in different components, eg. on one Upload component it should be "Type not allowed, please use .xlsx" and on another Upload component it should be "Type not allowed, please use .pdf"

Would that be possbile?
Thanks.

0
Stefan
Telerik team
answered on 21 Oct 2020, 11:01 AM

Hello, Raphael,

This could be achieved by using two different LocalizationProviders with different message collections.

Regards,
Stefan
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
General Discussions
Asked by
Raphael
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Raphael
Top achievements
Rank 1
Share this question
or