List Directory Files on Web Pages using html?

Posted by: darwin

List Directory Files on Web Pages using html? - 18/07/2002 08:28

I know it depends on the what web server your running but how do you list all files that is in a web folder to show up on an html page. Like some systems, if you don't have an index.html file, it will just list all the files and folders on the directory, like explorer. This other web server I have doesn't support it and says you are unauthorized to view this page, so I'd just like to write a simple html page that will list the directory contents if possible. Basically, I have a about 300 photos I want to share with some people, but don't want to make a link for every picture.

Thanks.
Posted by: wfaulk

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:33

(echo "<HTML><HEAD><TITLE>Pic Index</TITLE></HEAD><BODY>"

for file in *; do
echo "<A HREF=$file>$file</A><BR>"
done
echo "</BODY></HTML>") > pic_index.html
Posted by: Anonymous

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:39

what language is that?
Posted by: darwin

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:45

thanks for your reply, although it didn't seem to work. I just pasted the whole thing to notepad and called it my index.htm

anything else i'm supposed to do?

Posted by: wfaulk

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:50

My fault. I made the assumption you were using a real operating system. Since MSWindows comes with basically no useful tools, I don't know of a good way for you to do it. You'll have to copy and paste filenames and then edit it up by hand. At least they don't even provide you with a useful text editor, either.
Posted by: wfaulk

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:53

Ummm, Bourne shell....
Posted by: Dignan

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:56

well, you could always rename all the files using a batch rename program so they're all nice and in order, then create the first link and copy it a bunch of times, then have loads of fun with the arrow and number keys

It's not the most graceful solution, but then again in some ways neither is Gallery (the setup part at least).

Have you tried Gallery? It's quite a good program...
Posted by: pgrzelak

Re: List Directory Files on Web Pages using html? - 18/07/2002 08:57

Greetings!

Now, now... be nice... The language was shell - I am not certain which variation off hand.

It sounds like you are running either a microsoft personal web server under 95/98/ME or IIS under NT/W2K/XP. If you are running IIS, there is an option in your home directory configuration that will enable directory browsing. See if that is checked. Please post specifics about your OS and HTTP server. Thanks!