Spaces:
Running
Running
Commit
·
6f058fb
1
Parent(s):
64031c1
Update index.html
Browse files- index.html +20 -16
index.html
CHANGED
@@ -1,19 +1,23 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
+
<body>
|
4 |
+
|
5 |
+
<h1>Folder Upload Demo</h1>
|
6 |
+
|
7 |
+
<p>Drag and drop a folder, or click to select a folder:</p>
|
8 |
+
|
9 |
+
<input type="file" id="folderUpload" webkitdirectory directory multiple />
|
10 |
+
|
11 |
+
<script>
|
12 |
+
document.getElementById('folderUpload').addEventListener('change', function(e) {
|
13 |
+
const files = e.target.files; // FileList object
|
14 |
+
|
15 |
+
// loop through the FileList and print details
|
16 |
+
for (let i = 0, f; f = files[i]; i++) {
|
17 |
+
console.log('File:', f.webkitRelativePath);
|
18 |
+
}
|
19 |
+
});
|
20 |
+
</script>
|
21 |
+
|
22 |
+
</body>
|
23 |
</html>
|