Solved

How do I display contents of web directory?  Explorer-like

Posted on 2010-09-16
3
370 Views
Last Modified: 2012-05-10

I have a simple website that I tend to use to host small files I may need later on.  Attached is index.php, which is a little password protection script I found via Google.  It does the trick, but has its annoyances.

I would like to be able to go to www.mydomain.com/files , type in a password, then have the files listed something like this directory does:  http://devbuilds.kaspersky-labs.com/devbuilds/RescueDisk/

Or even an explorer-like display, but I don't care to get into huge plugins or services.  I've heard that ".htaccess" can help me do this, but I'm not quite sure what to do with that.

My provider is GoDaddy with their Linux server package.  


Thanks for any help!
0
Comment
Question by:devoleb
3 Comments
 
LVL 3

Expert Comment

by:Chocco
ID: 33698783
If you set up FTP access on your site, copy the files to the server, and then referr people to;

ftp.mydomain.com/files

you can then use the .htaccess file to control access..

A good complete guide for setting up an .htaccess file is below;

http://www.thesitewizard.com/apache/password-protect-directory.shtml
0
 
LVL 2

Accepted Solution

by:
Vygandasj earned 125 total points
ID: 33698796
Hello,

one way is to create .htaccess file with "Options +Indexes" in it. Here is nice info site about it. http://corz.org/serv/tricks/htaccess.php
0
 

Author Comment

by:devoleb
ID: 33721544
Thanks for the replies!

Chocco, while I agree this would be the simplest method, I would like to keep it under one protocol.  I'm unsure of everyone else's browers, firewalls, passive modes/etc.  So I went the .htaccess way minus FTP.

I had been reading about .htaccess, but had never heard of the Indexes option.  Thanks for the valuable info, Vyg.

For any GoDaddy web hosting users that are trying to achieve something like this, here is my .htaccess:


Options +Indexes
AuthName "Secure Area"
AuthType Basic
AuthUserFile /home/content/##/#######/html/.htpasswd
require valid-user



Create .htpasswd with "htpasswd -c .htpasswd your-user-name"

I then created the .htpasswd file in my root FTP directory, which is the servers' "html" directory.  All works as I need it.  You go to the website, enter username/pass, and are then presented with a list of contents in an easy-to-read format with file sizes and everything.

Thanks again
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now