Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to take folder as a input in html?

Tags:

html

If i want to take a file as a input in HTML i will be using

<input type="file">

Now my question is, is it possible to take a whole directory as a input,if yes how to do that?

like image 351
Hariharbalaji Avatar asked Dec 03 '09 05:12

Hariharbalaji


People also ask

How do you get input from a file in HTML?

The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!

What is Webkitdirectory?

webkitdirectory is a property that reflects the webkitdirectory HTML attribute and indicates that the <input> element should let the user select directories instead of files. When a directory is selected, the directory and its entire hierarchy of contents are included in the set of selected items.

How do I add folders to Codepen?

Click the New Directory button to add a new folder inside your current directory. The project root is the default if you don't have another directory selected. Enter your new directory's name in the yellow text field to give it a name.

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.


1 Answers

Not explicitly through HTML (although I'm not sure about HTML 5). You need some Java applet or Flash movie to do it. One way I do it is by using a custom PHP script that takes in a zip or tar file and decompresses it on the back end then dumps it.

like image 125
gonzofish Avatar answered Nov 08 '22 21:11

gonzofish