Auto generate a directory listing?

D

dougawells

Hi -
I'm hoping for help with the auto-generation of a hyperlinked listing
of all files in a directory. The server I use does not auto-generate
this. So, when someone comes to this directory and thus opens
index.htm, I want that file to show a listing of all files in the
directory with hyperlinks to them.

Thanks for the help,
Doug
 
R

Randy Webb

(e-mail address removed) said the following on 11/3/2006 1:59 PM:
Hi -
I'm hoping for help with the auto-generation of a hyperlinked listing
of all files in a directory. The server I use does not auto-generate
this. So, when someone comes to this directory and thus opens
index.htm, I want that file to show a listing of all files in the
directory with hyperlinks to them.

JS can't do it easily if at all. The best you could do would be to
manually create that index.htm file once a week or so.
 
P

pangea33

Hi -
I'm hoping for help with the auto-generation of a hyperlinked listing
of all files in a directory. The server I use does not auto-generate
this. So, when someone comes to this directory and thus opens
index.htm, I want that file to show a listing of all files in the
directory with hyperlinks to them.

Thanks for the help,
Doug

This requires a server-side scripting language like PHP. PM or post in
the PHP forum and I'll give you the code.
 
R

Randy Webb

pangea33 said the following on 11/4/2006 2:28 AM:
This requires a server-side scripting language like PHP.

No it doesn't. Client-side JS can do it but server side code is needed
to save the file.
 
E

Evertjan.

Randy Webb wrote on 04 nov 2006 in comp.lang.javascript:
pangea33 said the following on 11/4/2006 2:28 AM:


I doubt that, anonymus, as "index.htm" indicates a windows server, and an
ASP [or asp.net] code is the logical serverside implementation, which can
easily be implemented in serverside j[ava]script, but generally not in PHP.

No it doesn't. Client-side JS can do it but server side code is needed
to save the file.

I doubt that, Randy.

If index.htm is opened, the directory list is not reachable from
clientside. Serverside code will do nicely, however.
 
D

Dr J R Stockton

In message <[email protected]>, Fri,
3 Nov 2006 10:59:15 said:
I'm hoping for help with the auto-generation of a hyperlinked listing
of all files in a directory. The server I use does not auto-generate
this. So, when someone comes to this directory and thus opens
index.htm, I want that file to show a listing of all files in the
directory with hyperlinks to them.

If you can manage with incomplete automation - the tool you use, as
author, to manage that directory ought to be able to give you a list of
the file names in it. For example, WS_FTP has a DirInfo button which
shows the files in Notepad. You can save that file, and you can
copy'n'paste its contents.

You can then write a HTML/JS page, to be run locally by you, with a
TextArea into which you paste the raw list. A button can then invoke
javascript code to transform the list to be either the core or the
entirety of the desired index.htm, which you can copy out and upload to
your site. My <URL:http://www.merlyn.demon.co.uk/js-quick.htm> has an
Indt button which alters the TextArea.

With other programming tools, you can make it more automatic along the
same lines; for example, a Windows batch file might FTP the directory
and invoke WSH CSCRIPT javascript/vbscript to do the transform before
uploading.

That was written for Windows; it should be possible to do similarly on
other systems.

It's a good idea to read the newsgroup and its FAQ. See below.
 
A

ASM

Randy Webb a écrit :
pangea33 said the following on 11/4/2006 2:28 AM:

No it doesn't. Client-side JS can do it but server side code is needed
to save the file.

How client-side JS can do this (list of links) ?

How Is it possible to if :
my FAI has made something you can't list a folder on server --> 404
(say I'm in same case as pangea33)
 
A

ASM

Dr J R Stockton a écrit :
If you can manage with incomplete automation - the tool you use, as
author, to manage that directory ought to be able to give you a list of
the file names in it.

Fetch shows me the list of files of what folder (of course !)
but I'vent found a menu to output this list.
For example, WS_FTP

What is WS_FTP ?
My <URL:http://www.merlyn.demon.co.uk/js-quick.htm> has an
Indt button which alters the TextArea.

Would it be possible this page doesn't resize my browser's window?
:-(
C'est exaspérant !

Anyway, I understood anything what you want to show.
(I think you want to do too much things in an unique(alone) demo)
 
D

Dr J R Stockton

Sun said:
Dr J R Stockton a écrit :

What is WS_FTP ?

It's a Windows FTP program. Once upon a time, IIRC, my ISP supplied a
version with its mail/news/browser package, but I've updated since. I
think WS_FTP_LE (Light Edition) which I use is free for non-commercial
use. <URL:http://www.merlyn.demon.co.uk/pc-links.htm> links to
ftp://garbo.uwasa.fi/windows/winsock/ which presumably has or had it;
but Google should find its home site (a lad I know found it 20 days
ago). It may require Win95+; I've used it in 98 & XP.

Would it be possible this page doesn't resize my browser's window?
:-(
C'est exaspérant !

Not possible; the page is primarily for my own benefit on my PCs, and
copied to the Web on general grounds.

But remember that it says "Please do not use this actual Web page
repeatedly. If you like it, or parts of it, make your own private page
on your private local system, including only what is essential."

In your copy, you can remove or alter the two statements containing
window.resizeTo !!

BTW, I resize my local home page, By visiting it, I can be sure of
having the size of browser window that I prefer to design with (not
for); and it has links to resize itself to other common sizes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,441
Members
47,125
Latest member
MDBT

Latest Threads

Top