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

Using OnClientFileSelected not working

4 Answers 59 Views
CloudUpload
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Veteran
Mark asked on 13 Apr 2020, 02:02 PM

     Here is my code.  I am getting a yellow icon on the upload control and it is not uploading.

HTML

telerik:RadCloudUpload ID="CloudUpload" runat="server" MultipleFileSelection="Automatic" HttpHandlerUrl="~/UploadToCustomFolderHandler.ashx"  
OnClientFileSelected="onClientFileSelected" OnFileUploaded="CloudUpload_FileUploaded" AllowedFileExtensions="xlsx,xls,doc,pdf,docx,png,tiff" ProviderType="Azure">
</telerik:RadCloudUpload> 

JS

function onClientFileSelected(sender, args) {    
        var UBID =  document.getElementById('<%= hfUBID %>').value
        sender._module._handlerUrl = "/UploadToCustomFolderHandler.ashx?UBID=" + UBID;
}

It never gets to the HttpHandlerUrl as I have a break point set if it does. 

Here is the code in the handler that is not getting data.

string ubid = HttpContext.Current.Request["UBID"];

4 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
Veteran
answered on 14 Apr 2020, 01:36 PM
Since we have a valid license, what is the SLA for answering questions/issues?
0
Peter Milchev
Telerik team
answered on 15 Apr 2020, 11:44 AM

Hello Mark,

Please check for any JavaScript errors in the browser console or any failing requests in the Network tab.

  • A JavaScript error might prevent the proper behavior of the control while inspecting;
  • А failing request can point you in the right direction if, for example, the handler URL is the wrong one;

On the SLA about addressing queries, depending on the support plan it can vary for the Official Support Threads:

The forums are a public resource and community-driven and we try to answer as much as possible. Unfortunately, we cannot guarantee an answer on every thread or set a specific timeframe for an answer.

I have checked the account used to submit this forum thread and there are no valid licenses assigned to it. If your company has bought licenses for this product, please speak to the license holder.

The license holder can assign license developers and managers through Your Account, in the section Manage Licensed Users and re-assign them anytime. All assigned users will automatically receive credentials to log into the system.

Also see the FAQ question "What is the difference between license holder, developer, and manager?" from the link below:

If you are interested in the Legal agreements, they are available here:
Regards,


Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Mark
Top achievements
Rank 1
Veteran
answered on 15 Apr 2020, 12:02 PM

So someone else figured it out. This is working. 

function CloudUpload_onClientFileSelected(sender, args) {
        var ubID = $('#<%= hfUBID.ClientID %>').val();
        sender._module._handlerUrl = "/UploadToCustomFolderHandler.ashx?UBID=" + ubID;
    }

0
Peter Milchev
Telerik team
answered on 15 Apr 2020, 12:08 PM

Hello Mark,

Yes, the id seems to be the issue, as the server tag should return the ClientID of the asp:HiddenField. Other options to get the value are:

var ubID = $('#<%= hfUBID.ClientID %>').val();
var ubID = $get('<%= hfUBID.ClientID %>').value;
var ubID = document.getElementById('<%= hfUBID.ClientID %>').value;

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
CloudUpload
Asked by
Mark
Top achievements
Rank 1
Veteran
Answers by
Mark
Top achievements
Rank 1
Veteran
Peter Milchev
Telerik team
Share this question
or