Hi Team,
I want multiple selection of files and also i want to filter files so i am using RadAsyncUpload instead of RadUpload. But i am using it in radtoolbar itemtemplate like this :
<telerik:RadToolBarButton Value="Upload1">
<ItemTemplate>
<telerik:RadAsyncUpload runat="server" ID="rupfFile" AllowedFileExtensions="sqx,sqm,xls,xlsx"
MultipleFileSelection="Automatic" Localization-Select="Upload" Width="280" >
</telerik:RadAsyncUpload>
</ItemTemplate>
</telerik:RadToolBarButton>
But RadAsyncUpload looks different from its other toolbar buttons as attached file. So what i am trying to do is on click of radtoolbarbutton i will call radasynuploadbutton.click(). But it has no such event like radupload.
Do we have any other option to solve my problem ?
8 Answers, 1 is accepted
Here is one way to open the select window of RadAsyncUpload by using jQuery:
function
OnClientClicked(sender,args) {
$telerik.$(
".ruFileInput"
).click();
}
Hope this will be helpful.
Greetings,
Plamen
the Telerik team
But y doesnot it work on IE ???
This behavior can not be achieved in the Silverlight Upload Module that is why if you want it to work properly in IE you will have to add the following javascript code of set the DisablePlugIns="True" property:
Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable =
function
() {
return
false
; }
Hope this will be helpful.
All the best,
Plamen
the Telerik team
But now i am getting this error after selecting the file. (attached image file)
Following is my code:
This is control in the page.
1) <telerik:RadAsyncUpload runat="server" ID="rupfFile1" AllowedFileExtensions="sqx,sqm,xls,xlsx"
MultipleFileSelection="Automatic" Localization-Select="Upload" OnClientFilesUploaded="onClientFilesUploaded"
EnableInlineProgress="false" DisablePlugins="True"></telerik:RadAsyncUpload>
2) <telerik:RadToolBarButton Text="Upload" runat="server"
ClientIDMode="Static" Value="Upload" CommandName="Upload">
</telerik:RadToolBarButton>
3) On click of toolbar button i have called
$telerik.$(
".ruFileInput").click();
I have inspected the issue once again and it seems that IE does not support programmatical clicking
on a file input by default as explained in the forum. Please excuse me for misleading you with wrong information in the beginning.
Hope this will explain the issue.
Plamen
the Telerik team
As you said it will not work in IE. So i have used it inside radtoolbarbutton
<telerik:RadToolBarButton Value="Upload1" PostBack="false">
<ItemTemplate>
<telerik:RadAsyncUpload runat="server" ID="rupfFile" AllowedFileExtensions="sqx,sqm,xls,xlsx"
MultipleFileSelection="Automatic" Localization-Select="Upload" OnClientFilesUploaded="onClientFilesUploaded"
OnClientFileSelected="fileSelected" EnableInlineProgress="false" >
</telerik:RadAsyncUpload>
</ItemTemplate>
</telerik:RadToolBarButton>
But,there are some design issues.
When i select multiple files the background image of Radupload goes down some stpes below the control and radbutton disppears.when files are uploaded it comes back to its position.
Please find the attached files according to the same order.
Thank you for contacting us again.
I have inspected the code that you shared and the images attached and it seems that this issue is caused by the custom image you are using together with it. One possible solution I could think of is to hide it in OnClientFileUploading event and make it visible again in the OnClientFilesUploaded.
Hope this will help you solve the issue. If you have more questions I will be glad to assist you again.
Plamen
the Telerik team