MCPSERV.CLUB
Tiny File Manager

Tiny File Manager

Self-Hosted

Lightweight web file manager in a single PHP file

Active(86)
5.6kstars
0views
Updated 11 days ago
Tiny File Manager screenshot

Overview

Discover what makes Tiny File Manager powerful

Tiny File Manager is a **single‑file PHP application** that turns any web directory into a fully featured, browser‑based file manager. From a technical standpoint it exposes the entire filesystem through a stateless HTTP interface, leveraging native PHP extensions for file manipulation, compression, and MIME detection. The core of the application is a thin controller layer that parses user requests (CRUD, upload, download, archive operations) and renders the UI with Bootstrap 4. The use of `password_hash()` for authentication demonstrates a focus on modern PHP security practices, while the optional `$use_auth` flag allows developers to toggle session‑based protection or expose the manager in a read‑only mode.

Language & Runtime

Extensions

UI Layer

Data Storage

Overview

Tiny File Manager is a single‑file PHP application that turns any web directory into a fully featured, browser‑based file manager. From a technical standpoint it exposes the entire filesystem through a stateless HTTP interface, leveraging native PHP extensions for file manipulation, compression, and MIME detection. The core of the application is a thin controller layer that parses user requests (CRUD, upload, download, archive operations) and renders the UI with Bootstrap 4. The use of password_hash() for authentication demonstrates a focus on modern PHP security practices, while the optional $use_auth flag allows developers to toggle session‑based protection or expose the manager in a read‑only mode.

Architecture

  • Language & Runtime: PHP 5.5+ (recommended 7.x/8.x for performance). No external frameworks; the codebase is a monolithic script that includes configuration, language files, and helper classes.
  • Extensions: Requires fileinfo, iconv, zip, tar, and mbstring. These are used for MIME type detection, character set conversion, archive handling, and multibyte string operations.
  • UI Layer: Bootstrap 4 for responsive design, DropzoneJS for drag‑and‑drop uploads, and the Cloud9 IDE integrated editor (via CodeMirror) provide a rich client experience without additional server dependencies.
  • Data Storage: Authentication users are stored in an associative array ($auth_users) within the script; no database is required, making deployment lightweight. For advanced scenarios, developers can replace this array with a custom user store (e.g., MySQL, LDAP) by extending the authentication module.

Core Capabilities

  • File Operations: Create, rename, delete, copy, move, and download files/folders. Supports bulk actions via checkboxes.
  • Upload Mechanisms: AJAX‑based uploads with progress bars, drag‑and‑drop support, URL import, and extension filtering.
  • Archive Management: Create ZIP archives on‑the‑fly, extract archives, and decompress files directly in the browser.
  • Text Editing: Built‑in code editor with syntax highlighting for 150+ languages and 35+ themes, powered by Cloud9/CodeMirror.
  • Search & Filtering: Full‑text search across filenames and content, with type/extension filters.
  • Multi‑User Support: Each user can be assigned a dedicated root directory and permission set, enabling isolated environments within the same installation.

Deployment & Infrastructure

Tiny File Manager is designed for zero‑configuration self‑hosting. Deploy by dropping the single tinyfilemanager.php into any web‑accessible directory; PHP’s built‑in session handling takes care of state. It runs on any LAMP/LEMP stack that meets the extension requirements, making it ideal for shared hosting or Docker containers. A minimal config.php can override defaults (root path, authentication flag, language) without modifying the core file. For production use, developers should place the script behind HTTPS and restrict directory access via .htaccess or server‑level ACLs to mitigate the “avoid public use” warning.

Integration & Extensibility

  • Plugin Hooks: The code exposes a small set of hook points ($on_before_*, $on_after_*) that developers can tap into for custom logic (e.g., logging, external API calls).
  • REST‑like Endpoints: While not a full REST API, each action corresponds to an HTTP request with predictable parameters (action=delete, file=/path). This makes it straightforward to wrap the manager in a microservice or call it from other PHP scripts.
  • Webhooks: By extending the upload/delete handlers, developers can trigger external webhooks (e.g., CI pipelines, Slack notifications) after file operations.
  • Theme & Language Packs: The UI supports multiple themes and language files; adding a new theme or translating the interface involves dropping JSON/TXT files into the lang/ or themes/ directories.

Developer Experience

The project is heavily documented on its GitHub wiki, with clear sections for configuration, password hashing, and offline usage. Community support is moderate; the issue tracker shows active maintenance, and contributors can fork the single‑file repo for quick experimentation. The absence of a composer dependency tree keeps the learning curve low, but developers accustomed to MVC frameworks may find the monolithic structure less modular. Nevertheless, the code is cleanly commented, and the configuration array at the top of the file allows rapid customization.

Use Cases

  • Personal Cloud: Quickly set up a private web‑based file system for developers or designers to manage assets.
  • Embedded File Manager: Embed within a larger PHP application (e.g., CMS, SaaS platform) to provide file upload/download capabilities without building a separate module.
  • Testing & CI Environments: Spin up temporary instances in Docker to test file uploads or API endpoints that require a filesystem.
  • Educational Platforms: Offer students an in‑browser editor and file manager for coding assignments, leveraging the built‑in syntax highlighter.

Advantages

  • Zero Dependencies: A single PHP file means no composer installs or complex build steps.
  • Lightweight & Fast: Minimal memory footprint; PHP’s native functions handle most operations efficiently.
  • Open Source & MIT‑like License: No licensing constraints, making it suitable for commercial or proprietary projects.
  • Extensible Yet Simple: Hook points and REST‑style actions allow developers to extend functionality without

Open SourceReady to get started?

Join the community and start self-hosting Tiny File Manager today