Kendo Upload - Validate File Content

2 Answers 101 Views
Upload
Jerome
Top achievements
Rank 1
Iron
Jerome asked on 07 Dec 2022, 12:38 PM

Good day,

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.

Regards,

Jerome

2 Answers, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 12 Dec 2022, 08:02 AM

Hello Jerome,

Thank you for contacting the team.

The Upload supports three types of validation:

  • By file extension.
  • By maximum file size.
  • By minimum file size.

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.

 

Kind Regards,
Anton Mironov
Progress Telerik

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.

0
Jerome
Top achievements
Rank 1
Iron
answered on 12 Dec 2022, 09:40 AM

Good day,

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.

Thank you.

Regards,

Jerome

Anton Mironov
Telerik team
commented on 15 Dec 2022, 08:40 AM

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

Tags
Upload
Asked by
Jerome
Top achievements
Rank 1
Iron
Answers by
Anton Mironov
Telerik team
Jerome
Top achievements
Rank 1
Iron
Share this question
or