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

File Type

6 Answers 285 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 17 Sep 2012, 08:23 AM
Is there a way to restrict the file types that can be uploaded? Say to only images.

6 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 17 Sep 2012, 08:43 AM
Here you have a sample that restricts the uploads to be of jpg extension
http://jsbin.com/upekan/1/edit 
0
Andrew
Top achievements
Rank 1
answered on 22 Sep 2012, 03:51 AM
Thanks Nohinn,

To you know if there is a way to send some sort of filtering info to the browser so that when the user selects the file they see only images?
0
Jayesh Goyani
Top achievements
Rank 2
answered on 20 Oct 2012, 11:01 AM
0
JoJo
Top achievements
Rank 1
answered on 21 Dec 2012, 06:53 AM
Hi, 

The code in the above link will not select the file if the file is not in the required format.

I have a scenario, where the the user can select multiple different file types from the File Upload Dialog and on OnSelect event ( or any other appropriate event ) i want to discard the unsupported files from the list of select files so i can upload only the files with supported formats to the server. 

Multiple is set to True.

e.preventDefault(); - This is causing the entire file list to empty when the file list contains atleast one
unsupported file format.

Else if we can restrict the supported file types from the File Upload Dialog itself that would be awesome.

How do we do this ? Let me know your inputs.
0
JoJo
Top achievements
Rank 1
answered on 28 Dec 2012, 05:11 PM
Hi Kendo Team, 

Any help on the following issue.

I have tried to remove the unsupported files from the list (e.files) in the event "OnSelect" event but it didn't worked.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 29 Dec 2012, 03:52 PM
Hello,

As per my knowledge I think we are not able to do this thing.

Thanks,
Jayesh Goyani
Tags
Upload
Asked by
Andrew
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
JoJo
Top achievements
Rank 1
Share this question
or