Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to read the directory Folders name and size in Angular 4 using Typescript


What I have tried:

listFiles('C:\Users\nawab_ahmad\Downloads\get-folder-size-master')
.then(files => {
  console.log(files.entries)
    // do what ever you want with the file paths
});
Posted
Updated 31-May-18 5:42am

1 solution

You can't.

Code running in a web page does not have access to the user's file system. You can only access files which the user explicitly gives you access to, either by selecting them in an <input type="file">, or by dragging them into your page.

Using files from web applications - Web APIs | MDN[^]

And no, before you ask, there is no way around that. If there was, it would be a major security vulnerability.
 
Share this answer
 

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