Solved

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

Posted on 2010-09-16
3
376 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 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