0

I need to have a button to select a directory from local disk and then then returns the selected folder name using Javascript? Does anyone have some ideas?

PS: my code is only running on the client.

Ng2-Fun
  • 2,917
  • 9
  • 20
  • 42
  • 1
    You can't [access the file system or full file paths](http://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav) from the client. – Mike Cluck Jun 06 '16 at 20:43
  • Hi, my code is running on the client. I only know how to select files and get filenames. But for directory, I have no idea. – Ng2-Fun Jun 06 '16 at 20:46
  • @FelixKling I don't need to get the filenams. Instead, I just need to choose a directory, that's it. – Ng2-Fun Jun 06 '16 at 20:49
  • Yeah, I don't think you can select folders in JS/HTML/DOM. So it's simply not possible. What do you want to do with the name anyway? *edit*: Well, `` is the only way to access the file system. If it doesn't allow you to access folders, then bad luck. – Felix Kling Jun 06 '16 at 20:49
  • @Ng2-Fun That's what I'm saying. You can't get access to the path of the file (i.e, the directory it's in). You can select multiple files in a directory on some browsers but you won't have access to the directory name. – Mike Cluck Jun 06 '16 at 20:49
  • Also see http://stackoverflow.com/questions/2809688/directory-chooser-in-html-page – Barmar Jun 06 '16 at 20:50
  • @FelixKling: I need the folder path, and send it to another app for saving files. – Ng2-Fun Jun 06 '16 at 21:01

0 Answers0