So I have a basic form input with the type "file"
however I want the user to be able to select a folder location and not a file.
How can I get this input to select a folder and not a file, or is there another way to do it?
Stumbled on this page as well, and then found out this is possible with just javascript (no plugins like ActiveX or Flash), but just in chrome:
https://plus.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3
Basically, they added support for a new attribute on the file input element "webkitdirectory". You can use it like this:
<input type="file" id="ctrl" webkitdirectory directory multiple/>
It allows you to select directories. The multiple attribute is a good fallback for browsers that support multiple file selection but not directory selection.
When you select a directory the files are available through the dom object for the control (document.getElementById('ctrl')), just like they are with the multiple attribute. The browsers adds all files in the selected directory to that list recursively.
You can already add the directory attribute as well in case this gets standardized at some point (couldn't find any info regarding that)