AllowedFileExtensions ignored?

11 posts, 0 answers
  1. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 12 Sep 2011 Link to this post

    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?

  2. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 15 Sep 2011 Link to this post

    Reply please.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 15 Sep 2011 Link to this post

    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
  5. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 16 Sep 2011 Link to this post

    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?
  6. Bhavik
    Bhavik avatar
    1 posts
    Member since:
    Sep 2011

    Posted 17 Sep 2011 Link to this post

    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
  7. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 20 Sep 2011 Link to this post

    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
  8. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 20 Sep 2011 Link to this post

    Can you please answer my recent question?
  9. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 21 Sep 2011 Link to this post

    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
  10. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 21 Sep 2011 Link to this post

    Thank you very much.
  11. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 23 Dec 2012 Link to this post

    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" 
  12. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 26 Dec 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017