Pic List on Webpage, like Apache does....

edro

Lifer
Apr 5, 2002
24,326
68
91
I have a lot of pics hosted on my site and I noticed that Apache Servers always put a list of all the pics in that DIR so you can just clck on them instead of finding the actual pic name, then entering it in the URL.

Is there a way to do this other than with an Apache server? I use Dreamweaver..... I know I can make a page and put in all the URLs myself, but is there a way to do it so the page always automatically updates so all the pics in the DIR show up listed on the page?

Example: Here ya go. (thanks Valinos for the example)

Thanks a lot!
-Ed-
 

crab

Diamond Member
Jan 29, 2001
7,330
19
81
Usually make a file in notepad that just says "Options +Indexes"

Name it .htaccess (no ext)

Upload to said directory

I forget how to CHMOD it though.... 755 i think

CHMOD 644 actually :eek:
 

NikPreviousAcct

No Lifer
Aug 15, 2000
52,763
1
0
Originally posted by: edro13
Originally posted by: notfred
don't put an index.html in that directory.

Just tried that.....didn't work.

Did you get an error? What error? One would think you'd either get the restricted access error or the list of files...

nik
 

JayHu

Senior member
Mar 19, 2001
412
0
0
is the directory readable by public? I believe you have to do that..
did you do crab453's idea?
I second what he said anyway.
*edit*
wait I meant change the directory access settings, not creating a new file.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
you sure there's nothing in that directory besides images? I don't get an error, but an empty page.


What server are you running, anyway? IIS?
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
woops... just noticed you use apache... my apache install defaulted to allow directory listing.
 

edro

Lifer
Apr 5, 2002
24,326
68
91
I doubt I am using Apache.... It is hosted through Netfirms.com

I cannot find out what they use.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: edro13
Ok, I deleted the index.html

Now look at what is says.

What server is this, apache or IIS or what?

if it's apapche, do what crab453 said. If it's IIS, I have no idea.
 

edro

Lifer
Apr 5, 2002
24,326
68
91
This is on their support page:

Do you support .htaccess and/or .htpasswd?
No.
 

edro

Lifer
Apr 5, 2002
24,326
68
91
Well, it is probably IIS. Anyone have any other ways I can do it other than with .htaccess ?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Are you allowed to use cgi scripts? If so, This will work:

############################################

#!/usr/bin/perl

$dir = '.';

opendir DIR, $dir;
@array = readdir DIR;
closedir DIR;

foreach $file(@array) {
unless ($file eq 'list.pl'){
print qq~<a href="$file">$file</a><rb>\n~; # I fvcking hate fusetalk. <rb> should read with the 'r' and the 'b' in the opposite order.
}
}

############################################

save it as list.pl and run it from the directory you want to list the contents of.
 

kt

Diamond Member
Apr 1, 2000
6,032
1,348
136
Originally posted by: edro13
Well, it is probably IIS. Anyone have any other ways I can do it other than with .htaccess ?

Nope, according to www.netcraft.com your website is running Apache/1.3.26 (Unix) mod_perl/1.26 PHP/4.0.4pl1 mod_ssl/2.8.10 OpenSSL/0.9.6a on FreeBSD. I believe they disabled the use of .htaccess usage on the main Apache config file. Your best bet is use a PHP script to do the indexing.