By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,480 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,480 IT Pros & Developers. It's quick & easy.

Auto generate a directory listing?

P: n/a
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

Nov 3 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
do********@gmail.com 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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 3 '06 #2

P: n/a

do********@gmail.com wrote:
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.

Nov 4 '06 #3

P: n/a
pangea33 said the following on 11/4/2006 2:28 AM:
do********@gmail.com wrote:
>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.
No it doesn't. Client-side JS can do it but server side code is needed
to save the file.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 4 '06 #4

P: n/a
Randy Webb wrote on 04 nov 2006 in comp.lang.javascript:
pangea33 said the following on 11/4/2006 2:28 AM:
>do********@gmail.com wrote:
>>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.

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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 4 '06 #5

P: n/a
In message <11*********************@m73g2000cwd.googlegroups. com>, Fri,
3 Nov 2006 10:59:15, "do********@gmail.com" <do********@gmail.com>
writes
>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.htmhas 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.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Nov 4 '06 #6

P: n/a
ASM
Randy Webb a écrit :
pangea33 said the following on 11/4/2006 2:28 AM:
>do********@gmail.com wrote:
>>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.

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.
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)
--
ASM
Nov 4 '06 #7

P: n/a
ASM
Dr J R Stockton a écrit :
In message <11*********************@m73g2000cwd.googlegroups. com>, Fri,
3 Nov 2006 10:59:15, "do********@gmail.com" <do********@gmail.comwrites
>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.
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.htmhas 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)
Nov 4 '06 #8

P: n/a
In message <45**********************@news.orange.fr>, Sun, 5 Nov 2006
01:11:45, ASM <st*********************@wanadoo.fr.invalidwrite s
>Dr J R Stockton a écrit :
> For example, WS_FTP

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.htmlinks 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.

>My <URL:http://www.merlyn.demon.co.uk/js-quick.htmhas an Indt
button which alters the TextArea.

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.
--
J R Stockton
Nov 5 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.