Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hello,
i want to get directory address from html

like this :
/home/unwn13/works/task

some one helped me :
but it gave me the name of the one of the files in directory

any idea!

What I have tried:

<input type="file" id="picker" name="fileList" webkitdirectory multiple>




let picker = document.getElementById('picker');
let listing = document.getElementById('listing');

picker.addEventListener('change', e => {
  for (let file of Array.from(e.target.files)) {
    let item = document.createElement('li');
    item.textContent = file.webkitRelativePath;
    listing.appendChild(item);
  };
});
Posted
Updated 6-Sep-18 2:25am
v2
Comments
F-ES Sitecore 6-Sep-18 11:03am    
This probably isn't possible. You wouldn't want a web page reading what files were on your drive, so you won't be able to do it to others.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900