View Full Version : Trying to show a list of files in a directory on a web page

06-19-2006, 04:47 PM
Hi. Can anybody help.

I want to show a list of Word files, that are sitting in a separate directory, on my web page so that the user can open them. I can't just link them because the files within the directory are constantly changing, in name and volume. The directory is on a different server to my web page too.

What I would like is for the file list to be displayed when the web page opens. I have tried the 'Drop-Down Document Viewer II' and this is close to what I need except for a couple of points (i) it shows the files in an annoying "My Documents" style of window (I only want the files to show), (ii) I can only get the files to show if they are on the same server.

Does anybody know any code that would sort this out? I'd be very grateful.

Thanks for taking the time to read this.

06-19-2006, 09:58 PM
Sounds like a server side project and, for that, you would need either to be on the same server or at least be permitted to put a file on the server that hosts the files. If you don't have that kind of access, then you probably have no right to list their content anyway. If you do, and the server runs php or asp or anything like that, you can create a custom, on the fly, directory listing page but, it would need to be on the server that hosts the files that you want to list.

06-20-2006, 10:16 AM
:) Thanks John.

I do have access to post files on the server so this shouldn't be a problem - although it does mean having to have duplicate files because they are created on a separate server.

In terms of taking the left-hand blue panel off of the "My Documents" file listing or creating on-the-fly document listing, how would I go about doing this?

Many thanks again.

06-20-2006, 09:07 PM
Well then, the best way would be to make a page designed for the server that hosts the document files. What kind of page this could be depends upon what server side languages are available on the server. It may not have any but, most have either asp, or php or both available. I am most familiar with asp. I know this can be done in php as well and probably in some other server side languages.

So first you need to find out what, if any server side languages are available on this host. Once you figure that out, if it has one that will work to do this, you can just make up a page that will create an 'on the fly' listing of the files in the directory in question. This page can be designed to look however you want it to be and can be viewed in a frame or iframe from anywhere. It's listing can be actual links to the files.

To get a rough idea, here is an example of how this can be done in asp: