I'm writing a web app using Java, JSF and jQuery and I in my app I have a field, next to it I have a button, and I want in order to after click the button folder chooser dialog will appear. And after that path value will be sended to object in Java. I 'googled' it, but I found only one solution in jQuery where I can choose file, but I need to select a folder, not a file. Does anyone know which library shares that functionality? Should I do it in javascript/jQuery?
Asked
Active
Viewed 902 times
1
-
1Once you have the folder, what do you expect to do with it? – T.J. Crowder Jun 11 '16 at 11:11
-
File from URL address will be downloaded in this folder – dante Jun 11 '16 at 11:19
-
1You can't do that. Instead, you just return the file with the header `Content-Disposition: attachment` and the *browser* will allow the user to decide where to save it. – T.J. Crowder Jun 11 '16 at 11:20
-
It's good idea. Thank you. – dante Jun 11 '16 at 11:26
1 Answers
1
If you mean you want to choose a folder on the client side, you can't. In-browser JavaScript code doesn't have access to the workstation's file system, for fairly obvious security reasons. All you can do is drag-and-drop (which will give you one or more files, not folders), or use input type="file"
which will let the user choose one single file.

T.J. Crowder
- 1,031,962
- 187
- 1,923
- 1,875