Problem and Solutions
Get files and folders with Static HTML/JavaScript ?
By M.K. Verma · 3 May 2022

You can use an input field with type file, this requires user permission and as far as I know it is the only way of accessing directories and files from the client side.
<input type ="file" webkitdirectory="">