Sprawling file index written in PHP
- PHP 84.6%
- Shell 15.4%
| .gitignore | ||
| create_symlinks_in_subdirs.sh | ||
| example.png | ||
| index.php | ||
| LICENSE | ||
| README.md | ||
fileindexer
Minimal, single-file PHP directory index / file browser intended to be dropped into a folder tree and served by a normal web server (Apache/nginx + PHP-FPM). It renders:
- A folder list (links to subfolders)
- A file list with human-readable sizes
The app is implemented in index.php. The helper script create_symlinks_in_subdirs.sh can create index.php symlinks in all subfolders so navigation works without special rewrite rules.
Screenshot
Requirements
- PHP (tested with typical PHP 7/8 installs; no extensions beyond standard filesystem functions)
- A web server that can serve PHP (or the PHP built-in dev server for local testing)
Install
git clone ssh://git@git.disroot.org/drkt/fileindexer.git
cd fileindexer
If you want normal “click folder to enter it” navigation without any rewrite rules, create symlinks for index.php in subfolders:
chmod +x ./create_symlinks_in_subdirs.sh
./create_symlinks_in_subdirs.sh
Configuration
There’s no config file. Adjust index.php directly:
- Blacklist: edit the
$blacklistarray to hide files/folders from the listing. - Root detection: if a file named
.rootdirexists in the current directory, the UI shows an “About” link (tord-about.html) instead of a “Return” link.
Minimal usage example
- Put
index.phpin a folder with files/subfolders. - (Optional) run
./create_symlinks_in_subdirs.shso subfolders also load the browser. - Browse to the site, click folders to navigate, click files to download/view.
- Ideally create rd-about.html so that isn't a dead link.
