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

restrict file types

8 Answers 734 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John Crumpton
Top achievements
Rank 1
John Crumpton asked on 15 Sep 2011, 07:26 PM
is it possible to restrict the upload to only certain file types?
i am already validating that in the handler... but would prefer to just prevent the user from selecting an invalid file type.

8 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 16 Sep 2011, 07:51 AM
Hi John,

You can use the OnSelect client-side event to prevent the selection of files with invalid extensions. The handler validation is still required.

Note that you have to cancel the selection of all files if more than one is chosen at one go.

Greetings,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Q
Top achievements
Rank 1
answered on 06 Dec 2011, 05:25 PM
Is there anyway to do this via the kendo.upload.js?
0
T. Tsonev
Telerik team
answered on 06 Dec 2011, 06:08 PM
Hi,

Oops, wrong link, sorry! Try this one.

Regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Q
Top achievements
Rank 1
answered on 06 Dec 2011, 07:13 PM
nice, that covers part of it.  what about on the drag over, is there anyway to detect the file extension?
0
T. Tsonev
Telerik team
answered on 07 Dec 2011, 11:37 AM
Hi,

The select event will fire when you drop files as well. Same code applies without change.

All the best,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Q
Top achievements
Rank 1
answered on 07 Dec 2011, 03:03 PM
Yes, on drop it works, but what about on drag over?
0
T. Tsonev
Telerik team
answered on 07 Dec 2011, 04:41 PM
Hello,

I did a quick test in Chrome. the list of dragged files is not available in the dragover and dragenter DOM events. It is populated only when the actual drop occurs.

In short, we don't know what's being dragged until it's dropped.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Manuel
Top achievements
Rank 1
answered on 17 May 2012, 04:41 PM
hi

i have a problem uploading files, i mean any extension, i dont know if kendo upload support all file extensions.

thanks
Tags
Upload
Asked by
John Crumpton
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Q
Top achievements
Rank 1
Manuel
Top achievements
Rank 1
Share this question
or