Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directory Chooser in HTML page

Tags:

html

directory

How can I create a directory chooser in html page.
If I use input file element I can select file only, but I need to select directory instead.
I need to do this beacause the user should select a right path inside his computer.
Any solutions ?

like image 365
enfix Avatar asked May 11 '10 10:05

enfix


People also ask

How do you put a directory in HTML?

HTML can be used to open a folder from our local storage. In order to open a folder from our local storage, use 'HREF' attribute of HTML. In the HREF attribute, we specify the path of our folder.

How do I create a directory structure in HTML?

Step 1: Create a Folder Structure For Your Web Page First, open Finder (in Mac) or Explorer (in Windows). Next, create a folder (also known as a directory) called DevProject. This folder will contain all of the files for your HTML and CSS project. Open the DevProject folder.

What is the directory in HTML?

The <dir> HTML element is used as a container for a directory of files and/or folders, potentially with styles and icons applied by the user agent. Do not use this obsolete element; instead, you should use the <ul> element for lists, including lists of files.


1 Answers

Try this, I think it will work for you:

<input type="file" webkitdirectory directory multiple/> 

You can find the demo of this at https://plus.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3 , and if you need further information you can find it here.

like image 143
Raveendra007 Avatar answered Oct 06 '22 18:10

Raveendra007