How do I validate the content of a file on the upload event? I want to read the contents of an excel file and get a distinct list from one of the columns. Thank you.
Hello Jerome,Thank you for contacting the team.
The Upload supports three types of validation:
The following article provides further information about the Telerik UI Upload Validation:
Here is a demo of the Telerik Upload Validation:
In order to make the needed distinct filtration and validations, make it before using the Upload Component.
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Thank you for your response.
I am aware of the upload validations. However, I want to validate the file contents.
Should I use the Select event with a function? If so, how would I open the file and read its contents?
I thought by using the upload event and creating a byte array and copying the contents to a fileStream - but it looks like that only works for .txt files.
Hi Jerome,Thank you for the additional details provided.
The Telerik UI Components stands for visualizing the data provided. In order to upload, open, and read the Excel content, I would recommend using the Telerik UI Spreadsheet Component.
The following demo is representing the server import and export functionality:
For further information about the configuration, methods, and events of the Spreadsheet visit the following article:
I hope the Spreadsheet Component will help for achieving the desired result.
Best Regards,Anton Mironov