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

The telerik:FileFilter is not working

4 Answers 238 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 12 Aug 2012, 06:24 AM
I set the code is as below, the question is that why I still can see other file type while open file dialog?
  <FileFilters>
                        <telerik:FileFilter Description="Microsoft Office Document" Extensions="doc,docx" />
 </FileFilters>

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 15 Aug 2012, 11:07 AM
Hi,

 
Yes you are right file filtering doesn't work when neither Flash nor Silverlight upload modules are used as it is explained in this help topic. This is because browsers don’t provide native file filtering support at all. 

Hope this will explain the issue.

Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Mohammed
Top achievements
Rank 2
answered on 15 Aug 2012, 12:30 PM
Hi,
from the documentation I can get that the file filter is not working in IE, FireFox only if they use serverlight.
so if i use chrome or safari the file filter will not work ? 

I don't know why it is not working but there is another upload control that has file filter in all browsers while using flash, serverlight or HTML 5. 

http://ajaxuploader.com/demo/simple-upload-Validation.aspx 

so why our RadAsyncUpload control doesn't support the same ? 


0
Jin
Top achievements
Rank 1
answered on 16 Aug 2012, 06:07 AM
Currently, I want to remove all invalid file due to limited type. I know the RadAsyncUpload provide a client API named OnClientValidationFailed to handle it. If the control support multiple file select, while user select 4 invalid files, the method will be call 4 times. My question is how can I only alert a common message once instead of four times? Also about how to remove all links of invalid files, I refer your reply in http://www.telerik.com/community/forums/aspnet-ajax/async-upload/remove-link.aspx, I try your way, but the sample code is not correct. I think the correct code is as below:
 function validateCodeFile(sender, eventArgs) {
            sender.deleteFileInputAt(1);
        }

0
Peter Filipov
Telerik team
answered on 16 Aug 2012, 02:03 PM
Hi,

@Mohammed
I check the provided link and when the control is not using Silverlight/Flash module the filtering is not possible - it is a browser limitation. Please check the attached screenshot under Firefox. RadAsyncUpload control uses Silverlight/Flash/IFrame modules under IE browser in all other modern browsers our control is using a FileAPI module based on the File API HTML5.

@Jin
The FileValidationFailed event is fired for every of the uploaded files which does not pass the validation. It is not possible to fire it only once for all invalid files. Regarding the referenced example I changed it to work as expected, please review the attachment.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Jin
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Mohammed
Top achievements
Rank 2
Jin
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or