0

To open a popup window with a given url I use:

$("#OpenFolder").click(function () {
  var url = "https://stackoverflow.com";
  windowObjectReference = window.open(url, "ModulesList", "popup");
})

and

<button id="OpenFolder">OpenFolder</button>

Now I would like to open a folder located on the computer (where my script is) to have the possibility to select a file. What should be url (the path is something like /home/...) ? Thanks

MarioG8
  • 5,122
  • 4
  • 13
  • 29
olivier dadoun
  • 622
  • 6
  • 22
  • 3
    You can't do this solely programmatically - due to security issues the browser won't let you. There has to be some input from the user to specify the folder/file otherwise you could access anyone's files on their computer. For that you can use the [`FileReader API`](https://developer.mozilla.org/en-US/docs/Web/API/FileReader). – Andy Nov 23 '21 at 09:17

1 Answers1

0

Here is a similar issue previously asked. You can reference it for more info.

Open local folder from link

Himanshu Singh
  • 1,803
  • 3
  • 16