Viewing File Lists in Browsers

They have: 16 posts

Joined: Aug 2007

This is my first question here, and it's unbelievably simple, but I just cannot find out how to make a folder full of files visible to people browsing.

All I want to do is allow them to see the file index of a particular folder, so they can download one or more of the files.

I don't want to have to create an html page and update it every time I upload a file.

How's it done, chaps?

supersam33's picture

He has: 32 posts

Joined: Aug 2007

Just make a directory, something like /files and then upload all the stuff you want to be on that page into that directory, and just make the link on your site on your homepage Downloads. If you don't have an index page, it will just show all the contents within the folder.

The statement below is true.
The statement above is false.

They have: 16 posts

Joined: Aug 2007

Yes - I would expect to be able to do that, but in a browser I merely get the error message:

Forbidden
You don't have permission to access /folder/ on this server.

I've obviously missed something somewhere, even though I started with the files in a password-protected folder, I've now put them into an unprotected folder in the site's root folder, but still get this error.

supersam33's picture

He has: 32 posts

Joined: Aug 2007

Your hosting service may need you to have an .html index file, or else it wont work. I have had that problem before. or you might want to check your permissions, chmod it.

The statement below is true.
The statement above is false.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

If your host disabled it by default, all you have to do is create a file called ".htaccess", place it in that folder, and put the following line in that empty file.

Options +Indexes'

supersam33's picture

He has: 32 posts

Joined: Aug 2007

Some hosts dont allow you to use .htaccess though, that is why i hate some hosts, especially free ones... well atleast some of them

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

supersam33;222807 wrote: Some hosts dont allow you to use .htaccess though, that is why i hate some hosts, especially free ones... well atleast some of them

That's why it is worth paying a few $$ for a decent one. You can't expect something for nothing.

They have: 16 posts

Joined: Aug 2007

Thanks guys. As CHMOD is not something I'm familiar with, I tried the .htaccess file, but got this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
'
I may try enabling FTP access using a sub-domain, as the folder needs to be password-protected anyway, but that means users have to enter username and password twice.

Alternatively please point me to a CHMOD help site. Meanwhile I'll check with my hosting company, as the feature seems to be disabled on other sites I have hosted with them.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

CHMOD isn't going to help you. Please go into your server's error log and see what the error is.

supersam33's picture

He has: 32 posts

Joined: Aug 2007

I know what that error is. Freehostia.com doesn't have the best servers. I've used them before, they tend to always crash and give you those internal server errors. But they have really good and fast support, and usually fix it within an hour. But it is just really annoying... if you are looking for a free host try my-place or bytehost

The statement below is true.
The statement above is false.

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

supersam33;222839 wrote: I know what that error is.

What is it?

supersam33's picture

He has: 32 posts

Joined: Aug 2007

Just a server crash, the freehostia servers arent stable

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

supersam33;222842 wrote: Just a server crash, the freehostia servers arent stable

I don't think so. An "internal server error" almost always refers to an error in a script or configuration file. It the server crashed, the site wouldn't be available.

supersam33's picture

He has: 32 posts

Joined: Aug 2007

Freehostia automatically redirects your website to that page if the servers crash. Ive emailed them about this problem before

They have: 16 posts

Joined: Aug 2007

An update on this -
I contacted my hosting company and they told me that they do not support directory listings on their shared servers in order to maintain a high level of security. So that's that. I set up the page on a new sub-domain and put an FTP link on the main page, so people can view the file listing provided they have the username and password, plus IE 7 or Mozilla 2 which are FTP enabled.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.