0

Consider these file structures:

Parent
├── folder 1
│   └── sub1
│       ├── child a
│       └── sub2
│           ├── btn.xls
│           └── sample.docxs
└── folder 2
    ├── child 1
    └── child 2
        ├── mri.pdf
        ├── lake2.jpg
        └── exp_folder
            ├── exp1.png
            └── exp2.png

How can i read this file structures using plain javascript? I am not sure if there is a javascript equivalent of php's scandir() function.

Anirudh Lou
  • 781
  • 2
  • 10
  • 28

1 Answers1

0

You've said you want to do this in a browser. You can't, JavaScript code hosted in the browser in the usual way has no access to the file system. (Some browsers may offer some limited file system access to addons/extensions, but typically only sandboxed access.)

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875