Click to See Complete Forum and Search --> : Can Javascript query contents of dir on webserver n output a list of filenames?


telemann
08-27-2003, 02:01 PM
Hi, wondering if anybody knows if Javascript can query a directory on the webserver and return back an updated list of the contents? (I'm trying to make a photo slide show and want to be able to throw new files on the server, without having to update the shockwave that displays the images on the web.)

Thanks in advance!

Charles
08-27-2003, 02:05 PM
Originally posted by telemann
Hi, wondering if anybody knows if Javascript can query a directory on the webserver and return back an updated list of the contents? No.

halifaxrick
08-27-2003, 02:07 PM
I have done something similar. you are welcome to use the javascript in my site (it uses frames).

www.babyoctopus.com/babastuff/html/index.htm
www.babyoctopus.com/babastuff/html/main.htm
www.babyoctopus.com/babastuff/html/topright.htm

The other files referenced are just placeholders.

The site can be easily changed to slideshow.

Rick.

(remember to have directory view enabled when doing this by using .htaccess or httpd.conf in apache)

telemann
08-27-2003, 02:21 PM
cool, looks your script just might do it, thx!

pyro
08-27-2003, 03:31 PM
Originally posted by telemann
if Javascript can query a directory on the webserver and return back an updated list of the contents?Originally posted by halifaxrick
I have done something similar.That's not what that script does...

halifaxrick
08-27-2003, 04:39 PM
It's not exactally what he asked for, but it does do what he wants. For ages I tried to work out how to bung new piccys on the web (without using someones image service) without typing every image into a html file. The stuff on my site is the best way I could find to do it.


Rick.

pyro
08-27-2003, 10:45 PM
Serverside code would be the best way to do it. You could write a very simple script that would loop through all the files in a directory and display the files that are images. As a matter of fact, I just wrote one for someone in PHP: http://forums.webdeveloper.com/showthread.php?s=&threadid=15902#post83584

halifaxrick
08-28-2003, 08:41 AM
Cool, thanks for the link, if I get server side access I will use it as I am sure it will work quicker.

pyro
08-28-2003, 08:49 AM
You bet... :)