PDA

View Full Version : Java Script that reads contents of directory?


Medar
10-30-2002, 10:50 PM
I have a buddy that cannot run perl or php - and needs a java script that will read the contents of an image directory and output the file names to an html page.

I told him Javascript could do it - but I am not a JS programmer...and am not terribly familiar with it. I understand it is a client-side script...so now I am not certain this CAN be accomplished...

His ultimate goal is to have the script read the contents of the image directory, and then show each image as a thumbnail on an html page.

Is that something too hard to figure out, or has someone seen this canned somewhere?

Thanks in advance.

joh6nn
10-31-2002, 12:06 AM
well, you better start writing your buddy a nice apology, 'cause javascript can't do it. JavaScript has no file read, or write capabilities. sorry.

whammy
11-01-2002, 12:47 AM
However, you could do this easily with ASP or PHP (or any server-side scripting language, I would imagine).

If ASP is a possibility, check out http://www.w3schools.com/asp and look up:

FileSystemObject

it has some great examples. Actually there was a recent post that is a "MUST READ" sticky thread in the ASP forum (in my signature) that reads all files and folders in a website that could easily be adapted to do what you want if ASP is an option.