PDA

View Full Version : Loading a list of images into an array


Running Bear
12-20-2002, 03:39 PM
Does anyone have any advice or ideas on loading an unknown number of files from a directory. I want to pull out all the gif files and load them onto a page using javascript?

so what I need to do is loop through a directory adding the file name to an array where the file type is '.gif' Then loop through the array writting the images into a table.

Cheers Al

requestcode
12-20-2002, 06:12 PM
JavaScript can not read directories. You will have to use a Server Side language such as PHP or Perl to accomplish that.

ez4ne12c
12-21-2002, 12:51 AM
You could also use ActiveX controls inside a javascript..
it is not very secure..
it only works for IE but technically that would do what you want..
personally if you can use perl or PHP that is much better way to go
ez

Running Bear
12-30-2002, 02:18 PM
RequestCode & ez4ne12c,

Thanks for your tips :thumbsup:

Cheers Al

Graeme Hackston
12-30-2002, 04:40 PM
If you're using activeX you'll find this function helpful

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jscolfiles.asp

Running Bear
01-02-2003, 09:03 AM
Graeme,

Thanks for the link.

Cheers Al