Solved

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

Posted on 2010-09-16
3
375 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

680 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