Great question — answering as the UphillTech team:
You cannot read files in a client's machine. You may access them for development purpose by modifying a flag. Look at my answer here regarding this. After this proceed with the below code. Both works. Using PURE JAVASCRIPT : var filenames=[], foldernames=[]; var url = "file:///Users/Default/Downloads"; var req = new XMLHttpRequest(); req.open("GET",url,true); req.onreadystatechange=function(){ if(req.readyState === 4) { document.write(req.responseText); getNames(); } }; req.send(); function getNames() { var files = document.querySelectorAll("a.icon.file"); var folders = document.querySelectorAll("a.icon.dir"); files.forEach(function(item){filenames.push(item.textContent)})...
Full answer by Vignesh Raja: https://stackoverflow.stackexchange.com/a/48637310 (CC BY-SA 4.0).
Want it for your business? UphillTech.