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

AllowedFileExtensions ignored?

10 Answers 305 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 12 Sep 2011, 12:36 PM
Hello,
I have a template column in grid and RadAsyncUpload control created in template's InstantiateIn method. I assign image file extensions to AllowedfileExtensions property.
_uploadControl = new RadAsyncUpload()                                     
   {                                           ID = Item.user_name + "_upload",
                                               TemporaryFolder = HostingEnvironment.MapPath(Static.Config.Paths.UploadsFolder),                                                AllowedFileExtensions = _allowedExtensions,
                                              TemporaryFileExpiration = new TimeSpan(0, 0, 30, 0)
        }

That's what I do next:
1. Click "Select" button.
2. When open file dialog opens, there's no file mask on it.
3. I select any file and upload it.

4. Click "Remove" link
5. Open file dialog again and see the file mask is set correctly.
What should I do to fix that?

10 Answers, 1 is accepted

Sort by
0
Dmitry
Top achievements
Rank 1
answered on 15 Sep 2011, 10:05 AM
Reply please.
0
Genady Sergeev
Telerik team
answered on 15 Sep 2011, 11:22 AM
Hello Dmitry,

The file mask is quite buggy since it relays on third party plugins like Flash/Silverlight. Unfortunately I am not aware of fix to this problem since the issue comes from the very plugins. Because of this, and some other problems reported by our customers, we have decided to drop the plugins support for the HTML 5 File API compliant browser - FireFox 4.0+, Chrome, Safari 4.0. In this browser RadAsyncUpload will only use the HTML 5 native API, which unfortunately does not allow for file mask at all (it is to be implemented).

Greetings,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
Dmitry
Top achievements
Rank 1
answered on 16 Sep 2011, 01:36 PM
Thank you for reply. But what would you suggest me to do for now? Is there any property or whatever which allows me to force HTML5 upload feature on?
0
Bhavik
Top achievements
Rank 1
answered on 17 Sep 2011, 07:13 AM
Hello,

I am also facing the same problem. Actually I want to set file mask dynamically based on different conditions generated by two different radio button lists have two radio buttons in each. So its possible combinations are four(2x2). So I want to set different file mask for each combination from javascript. For that i have written it function and i am calling that function on radiobutton onclick event. But as Dmitry said, i am facing the same problem. For first time it will not set any file mask and it will allow all the files. But after removing that file and again click on select button at that time it will set file mast and file filter. And above reply Genady Sergeev has said that, this plugins does not support for the HTML 5 File API compliant browser like FireFox 4.0+, Chrome, Safari 4.0. But I am using IE 9, then also i am using the same problem. And another thing is that, this will work perfectly fine on server side, but the problem is when I set from server side the page post back to server for radio button selected item changes. But client side it will not work perfectly. In my case server side in not possible

So, please reply me for any solution or possible work around.

Thanks.
Br,
Bhavik Adeshara
0
Genady Sergeev
Telerik team
answered on 20 Sep 2011, 01:20 PM
Hello Bhavik,

Unfortunately currently there is no workaround for this issue (there is simply no API that allows you to set the file filter mask).

Greetings,
Genady Sergeev
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
Dmitry
Top achievements
Rank 1
answered on 20 Sep 2011, 01:46 PM
Can you please answer my recent question?
0
Peter Filipov
Telerik team
answered on 21 Sep 2011, 12:38 PM
Hi Dmitry,

You can disable Flash and Silverlight modules with the following javascript code. This will automatically push RadAsyncUpload control to use FileApi(if it is available) otherwise it will use IFrame module.

Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; };
Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function() { return false; };


Best wishes, 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
0
Dmitry
Top achievements
Rank 1
answered on 21 Sep 2011, 12:49 PM
Thank you very much.
0
Gal
Top achievements
Rank 2
answered on 23 Dec 2012, 05:00 PM
Hi I'm Experiencing the same problem is there any change on this issue ? 

I tried the code 
Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; };
Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function() { return false; };
 But I get the 
Uncaught TypeError: Cannot read property 'Modules' of undefined
 as the RadAsyncUpload is in Viable="false" 
0
Peter Filipov
Telerik team
answered on 26 Dec 2012, 07:47 AM
Hi Gal,

In order to suppress the usage of the plugins, please set the DisablePlugins property to true.

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
Dmitry
Top achievements
Rank 1
Answers by
Dmitry
Top achievements
Rank 1
Genady Sergeev
Telerik team
Bhavik
Top achievements
Rank 1
Peter Filipov
Telerik team
Gal
Top achievements
Rank 2
Share this question
or