Please register or login. There are 0 registered and 1356 anonymous users currently online. Current bandwidth usage: 326.30 kbit/s December 17 - 12:23pm EST 
Hardware Analysis
      
Forums Product Prices
  Contents 
 
 

  Latest Topics 
 

More >>
 

    
 
 

  You Are Here: 
 
/ Forums / Programming /
 

  Dynamic HTTP download directory listing 
 
 Author 
 Date Written 
 Tools 
Rooin Nov 05, 2008, 01:43pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List Replies: 13 - Views: 3803
I'm not sure how to word it to google it so I'm coming here to ask.


I host a basic web server out of my house, and for LAN's and other random occurrences I use my site to allow people to download files.

What I want to setup is a directory on my website, that people can pull up in their browser and it will just list the files available for download, without me having to create a list manually. Doesn't have to be fancy, and file name would suffice. I've setup a index page with links to each file, but I want to be lazy, and just let it dynamically update when files are added.
Now of course when I pull up a directory with just random files in it, it gives me the default page missing error.

Anyone know what I'm looking for, or is there some kind of http or script I can put into a index file to list the files of that directory automatically?


================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Want to enjoy fewer advertisements and more features? Click here to become a Hardware Analysis registered user.
Nov 05, 2008, 01:56pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List

Edited: Nov 05, 2008, 01:58pm EST

 
>> Re: Dynamic HTTP download Directory
What are you using for an http daemon?

If you're using Apache, add
Options +Indexes

to the .htaccess file in the directory (create if needed).

Rooin Nov 05, 2008, 02:02pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
I think its Apache, but its running on a proprietary flavor of linux on my synology NAS. I could login via SSH and add that I'm sure, but I only want that specific directory within the web root to have this feature, not the entire website. I like how it masks the other directories & files with a page missing error.

================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Bitmap Nov 05, 2008, 02:36pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
If it's Linux, it's most likely Apache.

http://httpd.apache.org/docs/1.3/mod/core.html#options

You can set certain directories only to have the Indexes option if you'd like. Play around with some settings in the .htaccess file until you get it just right.

________
"None of you understand. I'm not locked up in here with you. YOU'RE locked up in here with ME." - Walter Kovacs, A.K.A. Rorschach.
Rooin Nov 05, 2008, 02:40pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
That the only way to do it? by adding options to apache?

================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Bitmap Nov 05, 2008, 02:47pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
Or if you want to make a fancy "Soul's Downloads" page, you could write a little PHP and HTML. You'd have to talk to McFly about that, though. He's more of a PHP guru than I. :P

________
"None of you understand. I'm not locked up in here with you. YOU'RE locked up in here with ME." - Walter Kovacs, A.K.A. Rorschach.
Rooin Nov 05, 2008, 02:50pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
my server does support PHP/mySQL, and Ive dabbled with it a little. (very little)

That sounds more my route I think honestly. Going that way I could format the pages appearance too correct? make it fit into the web site if I wanted it to be "public" or make a public file dump page.

================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Bitmap Nov 05, 2008, 03:05pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
Yeah, you could format some HTML and CSS to give it a custom look, and just have an upload form. If you wanted, you could probably set categories too. Game patches, documents, etc. You'd just need the PHP upload form, and a few other things. Again, talk to McFly, he knows more than I do.

________
"None of you understand. I'm not locked up in here with you. YOU'RE locked up in here with ME." - Walter Kovacs, A.K.A. Rorschach.
Nov 05, 2008, 03:30pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
.htaccess isn't a global setting, it's per directory.

.htaccess is by far the easier way to go. It doesn't apply the setting to whole site (unless it's in the root directory, but even then it can be overridden by .htaccess files in subdirs).

So if you have something like this:
/public_html
-- /pub
-- -- /otherstuff
-- /private_stuff
-- /o_rly

If you added an .htaccess with that Options line to public_html (and no other dir has one), then yes, it will be site-wide. If you add it to pub, then it will only apply to /pub and /pub/otherstuff.

Rooin Nov 05, 2008, 07:06pm EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
ah ok.

Lets say I wanted to go the other way, what type of PHP coding would I be looking for to do that?

================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Bitmap Nov 07, 2008, 12:00am EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
You might want to look into this. I just stumbled across it in one of my RSS feeds.

http://css-tricks.com/improving-the-default-directory-view/

________
"None of you understand. I'm not locked up in here with you. YOU'RE locked up in here with ME." - Walter Kovacs, A.K.A. Rorschach.
Rooin Nov 07, 2008, 01:59am EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
Thank you very much

That works perfectly!


================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com
Bitmap Nov 07, 2008, 02:40am EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Dynamic HTTP download Directory
Woot! GLad to help! I love my RSS feedS!

________
"None of you understand. I'm not locked up in here with you. YOU'RE locked up in here with ME." - Walter Kovacs, A.K.A. Rorschach.
Rooin Nov 20, 2008, 01:12am EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List

Edited: Nov 20, 2008, 01:13am EST

 
>> Re: Dynamic HTTP download directory listing
Ok, another question. along a similar line.

Lets say I have my directory of files... <address>.com/files

Anyone know a way to essentially 1-click download file(s) from a specified web directory?

Like lets say I had .zip files in the directory. Is there anyway I can make a bat file, or some kind of script, that when I execute it, it will go to the <address>.com/files and look for any .zip (*.zip) files and download them to a specified directory on my PC? Or even better sync them. Only download the needed/new files?

================================================================
"Even Satan wouldn't use customer service as a form of punishment." - Lucas http://www.ctrlaltdel-online.com

Write a Reply >>


 

    
 
 

  Topic Tools 
 
RSS UpdatesRSS Updates
 

  Related Articles 
 
 

  Newsletter 
 
A weekly newsletter featuring an editorial and a roundup of the latest articles, news and other interesting topics.

Please enter your email address below and click Subscribe.