0

I want to use a file explorer in order to get the path of the element I'll select in this explorer.

Could I use something like this :

<input type="file"  webkitdirectory />

The problematic is :

I would ideally like to limit the selection to folders only, not files.

I want to retrieve the path of the selected folder in order to store it. (I'm using angularjs, so I was thinking of binding it through a model)

Is this possible or is there an alternative suiting my needs ?

Ellone
  • 3,644
  • 12
  • 40
  • 72

1 Answers1

0

You can't do it unless you use Java applet or Flash.

Please see this answer for details.

Selecting a file for upload is the best you can do, and even then you won't get its full original path in modern browsers.

You may be able to put something together using Java or Flash (e.g. using SWFUpload as a basis), but it's a lot of work and brings additional compatibility issues.

Community
  • 1
  • 1
Charlie
  • 22,886
  • 11
  • 59
  • 90