- Home /
WWW get files name to a folder
Hi, how can I get the names of files in a folder?
Now i use this:
string[] files = Directory.GetFiles(url);
But if I wanted to point to a folder online?
Thanks
Answer by Bunny83 · Aug 10, 2016 at 05:57 PM
The HTTP protocol doesn't have any such a feature. Some HTTP servers specifically create a directory listing HTML page to navigate through subfolders but generally there's no way to query the content of a web resource in a standardised way. You would need a server side script that collects the folder information on the server and returns that information as JSON or any other machine readable format.
Keep in mind that an URL path doesn't need to match any actual folder structure. Take UnityAnswers for example. "/questions/" is not an actual folder but just an indication for the server what kind of resource you want to view. The next part is the question ID (post ID) which is taken from a database. The actual HTML page that is returned at the end is generated on the fly.
Your answer
Follow this Question
Related Questions
How to supress a # into a path string 1 Answer
insert my folder into an apk 0 Answers
Wait for file download 1 Answer
HTTP Response Headers? 3 Answers
How to upload a file from Android to my own website? 0 Answers