1

I want to open a File Explorer from JavaScript. I tried using window.open("FolderPath"), it works fine but along with the file explorer it also opens a new web browser tab.

Is there a way to just open the File explorer?

Sumanth Rao
  • 59
  • 1
  • 1
  • 6
  • Do you want the user to select a file or just open the explorer? What browsers do you need to support? – Mike Cluck Jun 17 '16 at 17:01
  • I think it may be helpful if you could give a little more information. Why do you need to open the file explorer? Do you want your user to pick a file to upload or be used in your app or what? Also, window.open opens a url, if you use folder path you would need it to be used with a url like `file:///`, if you ran that on a webserver, it would look for the file relative to where you are and probably not find it. – Robert-W Jun 17 '16 at 17:12
  • So here's the thing, I have a button in my webpage which should just open a file explorer in a specific folder path and do nothing further, no uploads or file selects, so I cannot use a For this purpose when I use the window.open("FilePathUrl"), it opens a tab along with the file explorer. So I'm just wondering if there is a way to just open the file explorer. I'm using IE, I have used file:// along with the folder path. Thank you! – Sumanth Rao Jun 17 '16 at 17:23

2 Answers2

1

In general, allowing javascript to run programs is a big no-no.

See this related question.

Community
  • 1
  • 1
Hamilton Lucas
  • 419
  • 2
  • 5
0

well I don't have clear the question but I think that you can use a input with the type equals to file

<input type="file" id="someID" />
Dlanor
  • 266
  • 2
  • 13