Jump to content

Ftp Directory List In Html File

Recommended Posts



i would like to have a browsable ftp directory live inside an html page.

so the user, once logged in, sees the list of directories (and they are clickable links) and then a list of the contents of that directory when it is clicked. i wish for this to live in an HTML page and have the links to the directories and files just be there...i.e, i would not have to manually add html hrefs for each file. i know i could do that, but id' rather not given the amount of images and the time frame in which they get updated.


another advantage is if the ftp directory lives in an html page, the novice user does not get confused, as they can still see their menus for navigation.


i suppose i could accomplish this to a degree in frames, but i'd rather not use frames if i don't have to...the client is sour on them.


google searches have yield refereneces to windows server products.

and a search of these forums doesn't show anything relevant.

i may need to use different search terms.


anyway, i figure it must be possible via a server side include or via php.


thanks for your anticipated suggestions.




Link to post
Share on other sites

Have a look at http://movies.unibrain.org/


This is an FTP site wrapped in a standard header, footer and style sheet. The header and footer can be any valid HTML. If this is what your after, see http://httpd.apache.org/docs/mod/mod_autoindex.html


For my example,

.htaccess looks like

IndexIgnore robots.txt uptime.txt include scripts images style

IndexOptions DescriptionWidth=* NameWidth=*

IndexOptions +IconsAreLinks +SuppressColumnSorting +SuppressLastModified

IndexOrderDefault Ascending Size

AddDescription "US Government on how to stop ID Theft " IDTheftVideo.avi




There are two other files, HEADER.html which has my standard header, and README.html, which is a standard footer.

Link to post
Share on other sites

thanks for the link.

i'd rather hire someone to do it in PHP!


it may be an important piece of information to know that no one needs to upload, it's just strickly to download the files.


the closest thing i have found so far is:

force file d/l in php


any further help is apprecaited.






Link to post
Share on other sites



that not exactly what i want but SO MUCH better than what i have.

(my othe message above was posted before i saw you had posted a suggestion)


i am going to play with that right now...




if anyone knows of another solution please feel free to share it.





Link to post
Share on other sites

for got one thing...




what's your html file look like?


if i view source i believe i'm seeing the postprocessed file.

correct? i believe you are not adding the links manually.

Link to post
Share on other sites

The only thing I add manually is a description for the important stuff (see the .htaccess example) Everything else is automagic via mod_autoindex







UniBrain Movie Collection


<link rel="stylesheet" type="text/css" media="screen"

href="/style/screen.css" />

<script type="text/javascript" src="//scripts/scripts.js">




<div id="logo">

Unibrain Movie Collection



<!-- Cookie crumbs -->

<div id="bread">


<li class="first">

<a href="http://www.unibrain.org/">Unibrain</a>



» <a href="http://movies.unibrain.org/">Movies</a>








<p>I'm something of a collector, so anytime someone sends me a movie or

refers to one in a email or forum thread, I feel the need to save it. <br />

<strong>Beware:</strong> Some of the files are large and the uplink is not.</p>






<a href="java script:emailto('jim')">E-mail Jim</a>


<p>One Brain is enough for all of us.</p>


Link to post
Share on other sites


thanks i seem to be getting the hang of it.


had to add the line


HEADER path/to/header.html


as documented on the page link you included.


apache is nifty!



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...