Skip to content

Support selecting a file OR multiple files OR a directory with the same picker #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chrisguttandin opened this issue Mar 5, 2025 · 1 comment

Comments

@chrisguttandin
Copy link

As far as I can tell showOpenFilePicker() can only be used to select one or multiple files but no directory. On the other hand showDirectoryPicker() can select a directory but no individual files.

When a website can handle files and directories it needs to add two distinct buttons for the user to chose upfront what they want to select before opening the picker.

At least on macOS applications like Visual Studio Code can open file dialogs which support selecting anything. The user can select a single file, mutiple files, a directory, multiple directories, or any combination of the aforementioned options. It would be nice to offer the same flexibility for websites.

@tomayac
Copy link
Contributor

tomayac commented Mar 6, 2025

Confirming that this is technically possible on native and would be needed to bring apps like vscode.dev to feature parity with their native counterparts (for file opening):

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants