I’m working on an Angular app that can at some point contact an API to download a file. The download feature works fine, no problem with that. I use it to download a Python file.
The problem comes when I want the user to have the possibility to directly open the file in Vscode (if installed).
I know that you can open vscode from URL with the method described here (https://code.visualstudio.com/docs/editor/command-line#:~:text=Opening%20VS%20Code%20with%20URLs,-You%20can%20also&text=You%20can%20use%20the%20URL,%7Bfull%20path%20to%20file%7D%20.) :
Open a project
vscode://file/{full path to project}/
vscode://file/c:/myProject/
Open a file
vscode://file/{full path to file}
vscode://file/c:/myProject/package.json
However, to do that you need the full path of the file. In my case, the file is being downloaded in the download folder determined by the user on their browser’s settings.
I’m also aware of the security problems that accessing the local file path can provoke, but still I can’t believe that there is no way of opening a file in VScode from a web app (pretty I’ve seen that before though)
What am I doing wrong ? Is there really a way to open a file obtained from an API directly in VScode ?
Thank you for your help
I have already tried to use a file picker, which does not help because the path of the selected file is replaced by a fakePath by the browser security.