<input webkitdirectory> demo

The webkitdirectory attribute allows the user to pick a directory via a file input. All files (including nested files) inside that directory are added to the input’s files list. This attribute is supported in Chrome, Edge, and Firefox.

Pick a directory, and all files in that directory will be listed below, represented by their relative path.