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

AllowdFileExtensions ignore when RadAsyncUpload moved in DOM

2 Answers 59 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Andrew Dixon
Top achievements
Rank 1
Andrew Dixon asked on 05 Apr 2011, 04:20 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Peter Filipov
Telerik team
answered on 05 Apr 2011, 09:53 AM
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
0
Andrew Dixon
Top achievements
Rank 1
answered on 07 Apr 2011, 12:50 AM
Hi Peter,

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

Thanks
Andrew Dixon
Tags
AsyncUpload
Asked by
Andrew Dixon
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Andrew Dixon
Top achievements
Rank 1
Share this question
or