OpenFileDialog returns null if more than ~12 files are selected
See original GitHub issuePlatform: Windows 10, Avalonia 0.6.1
Hello! Given an OpenFileDialog initialized with AllowMultiple:
OpenFileDialog ofd = new OpenFileDialog();
ofd.AllowMultiple = true;
string[] files = await ofd.ShowAsync(VisualRoot as Window);
The OpenFileDialog returns null when selecting more than ~12 files, which is very limiting.
I don’t know much about the Windows API, but looking at SystemDialogImpl, this is probably coming from the 256 chars buffer. On Linux/Gtk3, the issue did not appear or the limit is bigger.
Maybe with AllowMultiple this buffer should be made far larger, or the API could expose this as a property?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
C# OpenFileDialog - exception when no files are chosen
String.IsNullOrEmpty(fileToCheck )) check. Another way - just put the code around fileToCheck which is currently outside of openFileDialog.
Read more >FileDialog returns null when attempting to open SMB address
Steps To Reproduce: 1.Run attached test case 2.Enter a network location into file dialog using SMB:// (for example SMB://servername/folder/filename.txt. You ...
Read more >"Get-Content" from file, after using the OpenFileDialog
So, it seems that the file is being selected and assigned to that variable properly, but for some reason there is a problem...
Read more >Update File Dialog Code to work with 32-bit AND 64-bit ...
I've updated my version of Microsoft Project 2019 from the 32-bit version to the 64-bit version. The code below does not open the...
Read more >OpenFileDialog Class (System.Windows.Forms)
This class allows you to check whether a file exists and to open it. The ShowReadOnly property determines whether a read-only check box...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@CommonGuy Thank you for the fix!
You’re right that’s the way to go, I also did not read well your first link that also dynamically resize the buffer.