Answer the question
In order to leave comments, you need to log in
How to get list of files in remote storage via js?
The bottom line is
I have some kind of remote image storage, for example www.site.images/
It stores images that I can access by type:
www.site.images/1.png
www.site.images/2 .png
www.site.images/photo/1.png
and so on...
Can I somehow get the whole hierarchy using js, what kind of pictures and folders are there?
I want to make an application for visualizing the repository, so I need to get the available directories from this repository and files for them, but I don’t know how to parse / get obviously unknown directories and files from there
Answer the question
In order to leave comments, you need to log in
If this is an external site, to the backend of which you do not have access, then there are several options:
1) Look, in DevTools, there may be some requests with which you can get the entire pool of images (most likely not).
2) If the pictures have some logically chosen names (for example, as you wrote, 1-2-3...), then you can sort through the url's until we hit an empty one. Then do the same with /photos/1-2-3...
If you have access, then there are also several options:
1) Make a small server application that will give the folder structure
2) Save pictures under the name in the same increment ( 1-2-3...), and then item 2 from the top list. But better, of course, is a small server application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question