1

I have a webpage that is using files from an image folder. Is there a way to get a list of all the folders within my hosted image folder, and also to check for any subfolders?

If this was done with node, I could use fs, but I do not know of a way to do this with a hosted webpage.

This would be part of a React app, and I would ideally like to find a way to get a nested array of the folders and subfolders so I can carry out further operations on them.

alexwojtak
  • 11
  • 3
  • Hi and Welcome to StackOverflow. You can't access the client's filesystem. What exactly do you need this info for? – Sherif Aug 01 '21 at 00:23
  • Particularly for large, batch uploaded, nested folders of images I want to iterate through, but also want to do different things to them based on folder and filename. – alexwojtak Aug 01 '21 at 00:26
  • 1
    I'm not certain I understand-- are you trying to get a list of all the folders and subfolders on your own server, or on the client's machine? – Alexander Nied Aug 01 '21 at 00:35
  • Maybe you would find https://stackoverflow.com/a/1593259/1878262 useful – Sherif Aug 01 '21 at 00:37
  • The trouble with that link is that I'd need to know the folders and filenames, as far as I can tell. My situation is a lot of files (in my case images) batch uploaded to a hosting solution like 123-reg but there are a large number of folders, some nested, that I would need to go through. – alexwojtak Aug 01 '21 at 00:53

0 Answers0