Allow `showOpenDialog` to open local files on web
See original GitHub issueIn the demo in https://github.com/microsoft/vscode-internalbacklog/issues/2178#issuecomment-901514989, I had to manually create a file in the web workspace since I couldn’t figure out a way to get vscode.window.showOpenDialog
to open a file on the user’s machine. Rob suggested that adding a file:///
URI as the defaultUri
might work, but it doesn’t.
Is opening a local file in this way already possible, and if not could we add a way for it to happen, perhaps using the defaultUri as Rob suggested?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to show an open file native dialog with Electron?
I am trying to add functionality to my Electron app that will allow users to open a file in the app, ...
Read more >How to Use File Choosers - Oracle Help Center
To display a file chooser, you usually use the JFileChooser API to show a modal ... Click the Launch button to run JWSFileChooserDemo...
Read more >3 Ways to Access Local Files From Web Browser | by Sunny Sun
Based on the HTML API, we have 3 approaches to accessing local files. Let's go deep into them. File type Input. HTML File...
Read more >dialog | Electron
To show all files, use the '*' wildcard (no other wildcard is supported). Note: On Windows and Linux an open dialog can not...
Read more >Read local files with the File API - Creative Bloq
Learn how to use the local file system to create apps that work better ... the input elements of type="file" now give developers...
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
Sounds good. Let’s dive into this more next iteration; Kai would like to get the referenced experience going by the end of this year 😃
There was some discussion somewhere about whether we should allow extensions to open local files on web which I now cannot find. If I remember correctly, the outcome of the discussion was that we wouldn’t allow it for now because:
Now we have a real need for it now though. Given the potential for error here, we should consider making the local file option for
vscode.window.showOpenDialog
opt-in, and not something that could be done by accident. Similar to theavailableFilesystems
option we have internally:https://github.com/microsoft/vscode/blob/ee1655a82ebdfd38bf8792088a6602c69f7bbd94/src/vs/platform/dialogs/common/dialogs.ts#L101-L107