AllowdFileExtensions ignore when RadAsyncUpload moved in DOM

3 posts, 1 answers
  1. Andrew Dixon
    Andrew Dixon avatar
    15 posts
    Member since:
    Apr 2010

    Posted 04 Apr 2011 Link to this post

    Hi,

    I have a situation where I need to move a RadAsyncUpload control in the DOM.  After I move it the AllowedFileExtensions seems to be reset to allow all extensions.  I have not been able to work out how to set the AllowedFileExtensions via javascript.

    Here is the problem isolated in a simple example.  Initially only jpg and wmv files can be selected.  But once I click the bt_MoveDiv button and move the control in the DOM, all file types can be selected.

    <body>
        <form id="form1" runat="server">
         
        <script language="javascript" type="text/javascript">
         
            function buttonClick() {
                var container = document.getElementById('container');
                var ph = document.getElementById('holder');
     
                ph.appendChild(container);
            }
         
        </script>
         
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
         
            <div id="container">
                <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" AllowedFileExtensions="jpg,wmv">
                </telerik:RadAsyncUpload>
                <telerik:RadProgressArea ID="RadProgressArea1" runat="server">
                </telerik:RadProgressArea>
                <asp:Button ID="bt_Submit" runat="server" Text="Submit" onclick="bt_Submit_Click" />
            </div>
             
            <div id="holder">
            </div>
             
            <asp:Button ID="bt_MoveDiv" runat="server" Text="Move div" OnClientClick="buttonClick();return false;" />
             
        </div>
        </form>
    </body>

    I had similar problems some time ago with RadEditor being moved in the DOM.  This problem was fixed with the onParentNodeChanged() function.  Is there something similar I can do for RadAsyncUpload?

    Thanks
    Andrew
  2. Answer
    Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 05 Apr 2011 Link to this post

    Hi Andrew Dixon,

    A possible solution is to use the Flash module to upload files. You need to disable your Silverlight module. Please add the following code to your page:
    <script language="javascript" type="text/javascript">
                 Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; };
    </script>

    Another solution is to check the allowed file extensions client-side with the method get_allowedFileExtensions(). For more details refer to the help article.

    Greetings,
    Peter Filipov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Andrew Dixon
    Andrew Dixon avatar
    15 posts
    Member since:
    Apr 2010

    Posted 06 Apr 2011 Link to this post

    Hi Peter,

    Adding that line to my javascript seems to have fixed the problem.

    Thanks
    Andrew Dixon
Back to Top