there should be an index.html of index.php which actually shows up whenever we type in the website names and prevents us from knowing the other files in the same directory. I want to know whether there is a way to find all the files in a directory which has got either index.html or index.php file.
There simply is no definitive answer for your question because there is no such functionality in http...
Sometimes requesting a robots.txt file does miracles.. Certainly if you use Google/2.X as useragent header..
for the simplest and for the most legitimate purpose, I want to see all files in the directory to invoke them by listing not by using URL. can you now give me one method on how to do this?
All you did just now was restate your question, I was asking because there is no legitimate reason to list files on a domain you do not own that are not public. There is also no way to do this over the http protocol as we already mentioned so no matter what your reason is we can not help you do this. I asked for a reason so that we could try to think of a better solution to your problem.