• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

Get Directory list of a site

Hi,

Can someone show me how to retrieve a directory listing from web. Example, given that

 www.mypage.com/thumbnails/

is a directory contains images, how do I get a similar action as File.List() call which shows me all the filenames of this directory?

I want to write a little applet that shows a slideshow of all the images stored on my site but I dont want to update a textfile everytime an image or file is added on!

Thanx
0
funnyveryfunny
Asked:
funnyveryfunny
  • 5
  • 5
  • 3
2 Solutions
 
CEHJCommented:
You can't, unless the web server has been set to perform a default listing of files. If it has, you can parse the html returned, e.g.

http://www.proteanit.net/misc/

but the server could have been cconfigured to return an error page
0
 
funnyveryfunnyAuthor Commented:
how about using a ftp library? would there be anything useful in there?:(
0
 
funnyveryfunnyAuthor Commented:
I'm looking at the possibility of JavaScript.FileSystemObject which can returns "file" objects. Appreciate if you could let me know if this is good idea? can we pass Javascript objects to applets?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
CEHJCommented:
Oh ftp is OK yes, if you've got a server running. That will support file listing and retrieval. I though the FileSystemObject was VB but i could be out of touch ;-)
0
 
funnyveryfunnyAuthor Commented:
Then ftp is out of question, please have a look at this page and give me your feedback:

http://www.webreference.com/js/column71/9.html

Thanx CEHJ.

0
 
CEHJCommented:
Yep, it's VB all right! AFAIK this is OK, but it hasn't got much to do with Java
0
 
objectsCommented:
> http://www.webreference.com/js/column71/9.html

No that will not help you.

> Can someone show me how to retrieve a directory listing from web

If you are managing the server then easiest would be to keep a file in the directory containing the contents and diwnload that file.
0
 
funnyveryfunnyAuthor Commented:
Thanx guys. feeling a bit floaty right now after watching Hero. Anyway

CEHJ: What does AFAIK mean?

Object: >If you are managing the server then easiest would be to keep a file in the directory containing the contents and diwnload that file.

This is what I'm doing right now with a text file contains all the file names/path.

The reason I suggested javascript is that I'm thinking of dynamically write a html file contains all the file names as Applet parameters then load them into my applet.

My files reside in geocites.com, so I think that itself is a server that allows client ftp connections. Maybe FTP can be used in this case, alternatively to above.

So guys if you can suggest me as many alternatives as you can think of, it would be much appreaciated. A Learning curve here :)
0
 
CEHJCommented:
>>CEHJ: What does AFAIK mean?

As Far As I Know

>>Maybe FTP can be used in this case, alternatively to above.

That would be the best. A text file would need to be kept in synch
0
 
objectsCommented:
> is that I'm thinking of dynamically write a html file contains all the file names as Applet parameters then load them into my applet.

thats another option if you dynamically create the html.

> Maybe FTP can be used in this case, alternatively to above.

sure, I thought you said earlier you couldn't use it.


you can use whatever server side technology is available to you.
0
 
funnyveryfunnyAuthor Commented:
Oops...pardon me Mr CEHJ ;)

Thanks guys you have enlightened me enough. A bow to you all.

Finally many thanx
0
 
CEHJCommented:
:-)
0
 
objectsCommented:
(:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 5
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now