Skip to main content
Home Forums General Silverlight Getting Started OpenFileDialog throws exception when lots of files are selected
5 replies. Latest Post by sl.ayer on September 16, 2009.
(0)
Gicanu
Member
0 points
3 Posts
09-15-2009 9:38 AM |
Hello,
I have a Silverlight control hosted in an asp.net web application, that calls the following code when a button is clicked:
OpenFileDialog ofd = new OpenFileDialog(); ofd.Multiselect = true;
if (ofd.ShowDialog() == true){ ..... }
When I select a large number of files (800+) the ShowDialog() mehtod throws the following exception:
{System.InvalidOperationException: ShowDialog failed. at System.Windows.Controls.OpenFileDialog.ShowDialog() at mpost.SilverlightMultiFileUpload.Page.SelectUserFiles() at mpost.SilverlightMultiFileUpload.Page.SelectFilesButton_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)}
Does anyone know how can I make it possible to open so many files?
From what I could find on the internet, there is some buffer that has to be set higher, but I could not find what is the exact setting in Web.config I have to modify.
Thanks,
prujohn
Contributor
3567 points
703 Posts
09-15-2009 9:41 AM |
Just out of curiousity, what is your use-case scenario for needing to open so many files at one time?
mchlsync
Star
14606 points
2,730 Posts
09-15-2009 10:07 AM |
I just tried with 2210 files from System32 folder. it's working fine.
XAML
<
</
C#
{
InitializeComponent();
}
ofd.Multiselect =
09-16-2009 9:39 AM |
I have no problem in satisfying your curiosity. The Silverlight control is part of an app that submits all this files to a printing server which has no problem in dealing with thousands of files.
09-16-2009 9:41 AM |
Thanks for the answer.
Can you tell me please what version of Silverlight and what browser you used?
Thanks
sl.ayer
Participant
848 points
162 Posts
09-16-2009 6:19 PM |
btw. web.config got nothing to do with silverlight.