Loading...
Logo
Processing Forum
Hi,

I try to list the files from an http folder in order to know if they are images or not before trying to load them using requestImage and i'm quite stuck. I've tried with the file class but seems that it doesn't work over http.
I can have the html code using the processing net library but i'm not sure how to list only images to get their names.
Does i have to use a lib like prohtml or jsoup for that purpose ?

Any help greatly appreciate.

Replies(1)

If the server doesn't expose this list, you are out of luck: no way to explore the folder hierarchy of a server from outside if they don't want (otherwise, it would compromise security).
If it exposes the list,eg. with a classical folder listing (default if access isn't prevented by .htaccess or even a simple index.html file), indeed you have to parse the returned HTML page. Using a library is probably the cleanest solution, manual parsing is prone to errors on some cases.
If that's your site, you can also put a simple text file there, listing the image files. It might be easier to parse.