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

RadUpload errors after uploading file

8 Answers 285 Views
Upload
This is a migrated thread and some comments may be shown as answers.
SSN
Top achievements
Rank 1
SSN asked on 14 Jan 2009, 11:23 PM
Hi,

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

Sort by
0
Valentin.Stoychev
Telerik team
answered on 15 Jan 2009, 09:04 AM
Hi S.Subbu,

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.
0
SSN
Top achievements
Rank 1
answered on 15 Jan 2009, 03:47 PM
Hi,
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.

 

0
Ivan
Telerik team
answered on 16 Jan 2009, 07:17 AM
Hi SSN,

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.
0
SSN
Top achievements
Rank 1
answered on 19 Jan 2009, 04:27 PM
Hi,
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.

0
Ivan
Telerik team
answered on 20 Jan 2009, 12:00 PM
Hello SSN,

After your last message about the issue I will suggest research on the following:


  • 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.
0
SSN
Top achievements
Rank 1
answered on 20 Jan 2009, 03:11 PM

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.

0
Juan Puebla
Top achievements
Rank 1
answered on 27 Aug 2009, 05:06 PM
I have de same problem. Did you found a solution?
0
Ivan
Telerik team
answered on 28 Aug 2009, 03:50 PM
Hi SSN,

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.
Tags
Upload
Asked by
SSN
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
SSN
Top achievements
Rank 1
Ivan
Telerik team
Juan Puebla
Top achievements
Rank 1
Share this question
or