Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2010 11:59:32 -0500
From:      Nathan Vidican <nathan@vidican.com>
To:        Anton Shterenlikht <mexas@bristol.ac.uk>
Cc:        Daniel Molina Wegener <dmw@coder.cl>, freebsd-questions@freebsd.org, Bill Moran <wmoran@potentialtech.com>
Subject:   Re: creating htmls from a directory tree?
Message-ID:  <795fc2b81002100859s2bba2d61nec5c85524dc248bc@mail.gmail.com>
In-Reply-To: <20100210163756.GJ58179@mech-cluster241.men.bris.ac.uk>
References:  <20100210150330.GC58179@mech-cluster241.men.bris.ac.uk> <20100210100536.150614a1.wmoran@potentialtech.com> <20100210151102.GD58179@mech-cluster241.men.bris.ac.uk> <201002101235.17641.dmw@coder.cl> <20100210163756.GJ58179@mech-cluster241.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Could do something simple with a Perl script as such:

#!/usr/bin/perl

use strict;
my @filenames = `ls`;

print "Content-type: text/html\n\n";

print "See the list below, click an item to open it: <br>\n<lui>\n";
foreach my $F (@files) {
  print "  <li><a href=\"$F\">$F</a></li>\n";
}
print "</lui>\n";

# EOF

You could, of course, get much fancier as it goes - but that's the quick and
dirty of doing it with a simple cgi script anyways.

--
Nathan Vidican
nathan@vidican.com

On Wed, Feb 10, 2010 at 11:37 AM, Anton Shterenlikht <mexas@bristol.ac.uk>wrote:

> On Wed, Feb 10, 2010 at 12:35:12PM -0300, Daniel Molina Wegener wrote:
> > On Wednesday 10 February 2010,
> > Anton Shterenlikht <mexas@bristol.ac.uk> wrote:
> >
> > > On Wed, Feb 10, 2010 at 10:05:36AM -0500, Bill Moran wrote:
> > > > In response to Anton Shterenlikht <mexas@bristol.ac.uk>:
> > > > > I'd like to upload a directory structure to a web
> > > > > server. I'd like to create in each subdirectory
> > > > > an index.html with a simple list of files in this
> > > > > directory for a simple browsing.
> > > > >
> > > > > This sounds like a perl or shell script, but
> > > > > I was wondering if there is someting like
> > > > > this already available from ports. I couldn't
> > > > > find anything suitable.
> > > >
> > > > You could just turn on Apache's built-in directory listing capability
> > > > and Apache will create those files on-demand.
> > >
> > > I see.. I need to talk to the web server guys then.
> >
> >   Also you can try WebDAV modules and clients ;)
>
> After a quick read on wikipedia,
> I think it's very unlikely the web server guys will
> be happy with this, from the security point of view.
>
> Anyway, thanks for the idea, now I know.
> anton
>
> --
> Anton Shterenlikht
> Room 2.6, Queen's Building
> Mech Eng Dept
> Bristol University
> University Walk, Bristol BS8 1TR, UK
> Tel: +44 (0)117 331 5944
> Fax: +44 (0)117 929 4423
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?795fc2b81002100859s2bba2d61nec5c85524dc248bc>