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

Value cannot be null. Parameter name : key

3 Answers 227 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Marc Roussel
Top achievements
Rank 2
Marc Roussel asked on 08 Apr 2011, 11:54 AM
Hi,

When I press the button Upload I get the error "Value cannot be null".  I've looked everywhere but unable to find the OnFileUploadCompleted and I don't know what to look for. Could you give me a hint on this ?  After the files are selected which they all appear in the list,  There's no errors and nothing seems to be wrong until I press UPLOAD.

Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
   at Telerik.Windows.Controls.RadUpload.OnFileUploadCompleted(Object sender, EventArgs e)

Here's the parameters I did set for the RadUpload

<telerik:RadUpload
    Grid.Column="1" x:Name="RadUpload1" Margin="0"
    Filter="Image Files (*.jpg;*.jpeg;*.png)| *.jpg;*.jpeg;*.png"
    FilterIndex="0" MaxFileCount="500"    
    AllowDrop="true" Width="Auto"
    IsAutomaticUpload="false"
    OverwriteExistingFiles="True"
    UploadServiceUrl="../receiver.ashx"
    IsAppendFilesEnabled="True"
    FileUploadStarting="RadUpload1_FileUploadStarting"
    FileUploaded="RadUpload1_FileUploaded"
    UploadStarted="RadUpload1_UploadStarted"
    MaxFileSize="12000000" MaxUploadSize="900000000" SelectionMode="Multiple" 
    MinWidth="0" MinHeight="0" MaxHeight="Infinity" Style="{StaticResource  
    RadUploadStyle1}" TargetFolder="~/ClientBin/Photos" BufferSize="900000000" />

3 Answers, 1 is accepted

Sort by
0
Marc Roussel
Top achievements
Rank 2
answered on 08 Apr 2011, 12:01 PM
I did remove the BufferSize I did set and it worked.  Could you explain how I can make this buffer huge without having the error ?
0
Alex Fidanov
Telerik team
answered on 13 Apr 2011, 03:06 PM
Hello Marc Roussel,

I belive the default POST request buffer size is around 2mb. If you want to use a larger size, then you have to configure the server to be able to accept larger requests. To enable this, you have to add the following line in the web.config file -> system.web section: For example, this will allow 10mb buffer size :

<httpRuntime maxRequestLength="10000000" executionTimeout="3600" />


Let me know if that works for you.

Greetings,
Alex Fidanov
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
Marc Roussel
Top achievements
Rank 2
answered on 13 Apr 2011, 03:20 PM
Oh thank you.
Works fine.
Tags
Upload
Asked by
Marc Roussel
Top achievements
Rank 2
Answers by
Marc Roussel
Top achievements
Rank 2
Alex Fidanov
Telerik team
Share this question
or