Select folder / directory in an input

4

I'm trying to create something that looks like input type="file" , except that instead of loading a file, I'd have to choose a folder. Something like the "Save As" window, where we chose the folder to save the file.

In this example, I would look for the folder C:/Users/cesarcacao/Desktop

I would like to put some code attempt, but I have not been able to build anything concrete yet.

    
asked by anonymous 11.11.2014 / 11:41

1 answer

3

There is an attribute called webkitdirectory on the G + page of Addy Osmani it better explains how it works, here a demo.

<input type="file" multiple webkitdirectory id="pasta"/>

I tested it here and it worked in Chrome / Opera.

For security reasons the current browsers do not allow you to get the full path of the file. Only IE7 down, source

    
11.11.2014 / 11:51