Solved

Get Directory list of a site

Posted on 2004-09-27
13
422 Views
Last Modified: 2008-02-07
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
Comment
Question by:funnyveryfunny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 3
13 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 12163239
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
 
LVL 4

Author Comment

by:funnyveryfunny
ID: 12163271
how about using a ftp library? would there be anything useful in there?:(
0
 
LVL 4

Author Comment

by:funnyveryfunny
ID: 12163309
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 86

Expert Comment

by:CEHJ
ID: 12163333
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
 
LVL 4

Author Comment

by:funnyveryfunny
ID: 12163364
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 12163417
Yep, it's VB all right! AFAIK this is OK, but it hasn't got much to do with Java
0
 
LVL 92

Expert Comment

by:objects
ID: 12164878
> 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
 
LVL 4

Author Comment

by:funnyveryfunny
ID: 12165007
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
 
LVL 86

Accepted Solution

by:
CEHJ earned 25 total points
ID: 12165023
>>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
 
LVL 92

Assisted Solution

by:objects
objects earned 25 total points
ID: 12165055
> 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
 
LVL 4

Author Comment

by:funnyveryfunny
ID: 12165115
Oops...pardon me Mr CEHJ ;)

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

Finally many thanx
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12165135
:-)
0
 
LVL 92

Expert Comment

by:objects
ID: 12165149
(:
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question