Click to See Complete Forum and Search --> : displaying folder contents
sureshp
07-25-2007, 04:17 AM
Hi!
How can I show the contents of one folder in one web page, by clicking on link which will redirect the user to this page? is it possible with html? if yes please help me!
thanks in advance!
Ferret
07-25-2007, 09:42 AM
It's possible to share a folder through a web server, if that's what you're looking for... you'll have to look up how to do it with whatever OS and Server you're using though, to get the specifics on how to make it happen.
Tweak4
07-25-2007, 02:24 PM
If you're just looking to display a list of the files in a given directory, than html alone can't do it.*
Fortunately, PHP comes to the rescue, as it is relatively easy to do exactly that. I set up a script in one of my directories that lists everything else in that directory, sorts the list by type (files vs folders, and then by file extension), sorts those results by name, and then generates a list where each entry is a link to the file in question. If that is what you're looking to do (and your server supports php), we can coach you through it.
*Ok, while it can't be done with html alone, it technically can be done using jscript, but it involves ActiveX, the FileSystem Object and a bunch of other IE-only sorcery. It works under a specific set of circumstances, but for most applications it is a very bad approach.
ray326
07-25-2007, 10:49 PM
If the directory is within the web server's servable tree and the URL presented is mapped to that directory and there is no index file in the directory and directory indexing is allowed by the web server's configuration then the server will generate an HTML page that is a list of the files in the directory.