Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Summernote and form validation 10 93
How can I split the array as 4 rows per line? 5 79
Best Practice CSS floating images 2 32
REReplaceNoCase help 1 11
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

932 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

12 Experts available now in Live!

Get 1:1 Help Now