We are using RadUpload and getting error when we hit upload button, and the header says uploading... with 0% but displays correct file size and RadUpload even loads file to the destination folder.
We could not receive any handle to upload button click event or uploadfinished event.
The error message is as below:
Unhandled error in silverlight 2 application
code:4004
Category: ManagedRuntimeError
Message: System.Collections.Generic.KeyNotFoundException:The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary'2.get_Item(TKey key)
at Telerik.Windows.Controls.FileUploader.OnResponse(IAsyncResult asyncResult)
at System.Net.BrowserHttpWebRequest.<>c_DisplayClass.............
Please let me know if there is any issue with the release version. We use 2008.3.1117.1020 version of Controls.Input and
2008.3.1117.20 version of RadUploadHandler.dll.
Thanks,
S.Subbu.
8 Answers, 1 is accepted
we are not aware of such a problem with this version of Rad Upload for Silverlight.
Are you by any chance using a custom upload handler, or are you playing with custom parameters to/from the upload handler? Can you elaborate more on your setup.
Thanks!
All the best,
Valentin.Stoychev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
We have the handler as below:
<%
@ WebHandler Language="VB" Class="RadUploadHandler" %>
Imports
System
Imports
System.Web
Public
Class RadUploadHandler
Inherits Telerik.Windows.RadUploadHandler
End
Class
Before applying the new version, we were able to proceed.
RadUpload in xaml is as below:
<
Telerik:RadUpload x:Name="UploadFiles"
TargetFolder="Upload/UploadedFiles"
Filter="Excel files (*.xls)|*.xls|Text Files (*.txt)|*.txt"
FilterIndex="0" IsAutomaticUpload="false" OverwriteExistingFiles="True" IsMultiselect="False"
HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Height="100" />
Thanks,
S.Subbu.
Looking at xaml-code RadUpload definition I can not find the initialization of the UploadServiceUrl property - there should be something like:
UploadServiceUrl="http://localhost/RadUploadExample/MyRadUploadHandler.ashx"
if this is not the issue - i.e. you initialize this property in the code-behind please prepare a simple project where the error occurs and send it to us for further investigation. We we get back to you with our findings shortly.
Greetings,
Ivan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
We have UploadServiceUrl in the code behind as below:
string temp;
temp="";
ap.HostAddress = (string)System.Windows.Browser.HtmlPage.Window.Invoke("GetHostAddress", temp).ToString();
HoldRadUpload.UploadServiceUrl = "http://" + ap.HostAddress + "/RadUploadHandler.ashx";
and in ashx
<%@ WebHandler Language="VB" Class="RadUploadHandler" %>
Imports System
Imports System.Web
Public Class RadUploadHandler
Inherits Telerik.Windows.RadUploadHandler
End Class
Thanks,
S.Subramanian.
After your last message about the issue I will suggest research on the following:
- A possible reason may be if you are trying to upload across domains. If this is the case please follow the instructions at Making a Service Available Across Domain Boundaries.
- If this is not the case please try to access the upload handler directly in your web-browser and check whether the response looks like:
{"JSONData":[{"Key":"RadUAG_message","Value":"Empty file name"},{"Key":"RadUAG_success","Value":false}]}
- If the response is OK please check whether the target folder is physically available and the access rights are ok.
Kind regards,
Ivan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Hi Ivan,
With the upload control we were able to browse a file, click upload button which actually uploads the file into the target folder and after that it fails to return the event handler(completed events).
As you suggested I'll check the cross domain and the key RadUAG_message.
Thanks,
S.Subbu.
If want to get more specific details about RadUpload please review this article where the postprocessing of uploaded files is discussed.
All the best,
Ivan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.