Is there a way in Javascript that we can get a folder in the root folder to a variable then use .getFiles() to get the files in that folder?
I worked with scripting in Photoshop with Javascript and these codes works:
Destination = Folder ('G:/My Projects/Project 2/Sounds');
Files = Destination.getFiles();
But in web developing it does not work. Is there a way? Thank you.
Is there a way that I can use paths like (‘/Sounds’) ?
2
Answers
The browser doesn’t allow you to access the file system due to security reasons.
What if any page you visit could do this?
No. For your web browser, the root of the folder starts at html page you are serving. Only those directories and sub-directories which lie within the same folder as the html page can be accessed. To achieve what you desire, you probably need to write a server too.
yeah. if you have following directory structure
Only
dir1
,dir2
anddir3
contents can be accessed.file1
can’t be accessed.